Skip to content

Commit

Permalink
fix webpack.config: inconsistent regex for path separator fails linux…
Browse files Browse the repository at this point in the history
… build
  • Loading branch information
david@DAVID-PC authored and davidjenni committed Nov 8, 2021
1 parent e2ced99 commit 6ba9f4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions gulp/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ function setContributions(manifest) {

async function addTaskFiles() {
const filesToCopy = []
.concat(await findFiles(/tasks[\/\\].*[\/\\]task.json$/, "src"))
.concat(await findFiles(/tasks[\/\\].*[\/\\]icon.png$/, "src"))
.concat(await findFiles(/tasks[\/\\].*[\/\\]index.js$/, "dist/src"));
.concat(await findFiles(/tasks[/\\].*[/\\]task.json$/, "src"))
.concat(await findFiles(/tasks[/\\].*[/\\]icon.png$/, "src"))
.concat(await findFiles(/tasks[/\\].*[/\\]index.js$/, "dist"));

await Promise.all(
filesToCopy.map((file) => {
const relativePath = file
.replace(/src[\/\\]/, "")
.replace(/dist[\/\\]/, "");
.replace(/src[/\\]/, "")
.replace(/dist[/\\]/, "");
return copy(file, `${stagingDir}/${relativePath}`);
})
);
Expand Down Expand Up @@ -194,7 +194,7 @@ async function generateAllStages(manifest, taskVersion) {
}

taskJsonFiles.map((entry) => {
const taskName = /^out[\/\\]staging[\/\\]tasks[\/\\]([^/\\]*)/.exec(
const taskName = /^out[/\\]staging[/\\]tasks[/\\]([^/\\]*)/.exec(
entry.file
)[1];
const taskJson = {...entry.json};
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { resolve } = require("path");
const nodeExternals = require("webpack-node-externals");
const find = require("find");

const tasks = find.fileSync(/tasks[\/\\].*[\/\\]index.ts$/, "src");
const tasks = find.fileSync(/tasks[/\\].*[/\\]index.ts$/, "src");

module.exports = tasks.map((task) => ({
entry: `./${task}`,
Expand Down Expand Up @@ -31,7 +31,7 @@ module.exports = tasks.map((task) => ({
},
},
output: {
filename: task.replace(/\.ts$/, ".js").replace(/src\//, ""),
filename: task.replace(/\.ts$/, ".js").replace(/src[/\\]/, ""),
path: resolve(__dirname, "dist"),
},
}));

0 comments on commit 6ba9f4f

Please sign in to comment.