Skip to content

Commit

Permalink
Merge pull request #1236 from liferay/wincent/windows-build
Browse files Browse the repository at this point in the history
fix: console errors in Windows-based build (#1228)
  • Loading branch information
julien committed Apr 24, 2019
2 parents 1f3ff2f + ab2b34d commit 31857ea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webpack.common.js
Expand Up @@ -11,6 +11,14 @@ function toAbsolute(rootRelativePath) {
return path.join(__dirname, rootRelativePath);
}

/**
* For windows compatibility, we need to use windows path separators for webpack
* "test" properties.
*/
function toTestRegExp(file) {
return new RegExp(path.normalize(file).replace(/\\/g, '\\'));
}

const base = {
/**
* https://webpack.js.org/configuration/entry-context/
Expand All @@ -28,7 +36,7 @@ const base = {
loader: 'babel-loader',
},
{
test: /scripts\/build\/version\.js$/,
test: toTestRegExp('scripts/build/version.js'),
use: {
loader: 'val-loader',
},
Expand Down

0 comments on commit 31857ea

Please sign in to comment.