Skip to content

Commit d84ef11

Browse files
committed
WIP - updating test to fail on Windows... and fixing it
1 parent 1e93c32 commit d84ef11

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/config/validator.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ class Validator {
5151
}
5252

5353
if (!this.webpackConfig.manifestKeyPrefix) {
54-
const outputPath = this.webpackConfig.outputPath.replace(/\/$/, '');
54+
let outputPath = this.webpackConfig.outputPath;
55+
// for comparison purposes, change \ to / on Windows
56+
outputPath = outputPath.split('\\').join('/');
57+
58+
// remove trailing slash on each
59+
outputPath = outputPath.replace(/\/$/, '');
5560
const publicPath = this.webpackConfig.publicPath.replace(/\/$/, '');
5661

5762
/*

test/config/validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('The validator function', () => {
5555

5656
it('manifestKeyPrefix is correctly not required on windows', () => {
5757
const config = createConfig();
58-
config.outputPath = '/some/path/to/build';
58+
config.outputPath = 'C:\\projects\\webpack-encore\\web\\build';
5959
config.setPublicPath('/build/');
6060
config.addEntry('main', './main');
6161

0 commit comments

Comments
 (0)