Skip to content

Commit 58be365

Browse files
authored
fix: Modify Webpack sourcemap parameters to account for Windows path separators (#2465)
1 parent 759d71b commit 58be365

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

examples/custom-generator-codelab/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module.exports = (env, argv) => {
4646

4747
// Include the source maps for Blockly for easier debugging Blockly code.
4848
config.module.rules.push({
49-
test: /(blockly\/.*\.js)$/,
49+
test: /(blockly[/\\].*\.js)$/,
5050
use: [require.resolve('source-map-loader')],
5151
enforce: 'pre',
5252
});
5353

5454
// Ignore spurious warnings from source-map-loader
5555
// It can't find source maps for some Closure modules and that is expected
56-
config.ignoreWarnings = [/Failed to parse source map/];
56+
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
5757
}
5858
return config;
5959
};

examples/custom-renderer-codelab/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module.exports = (env, argv) => {
4646

4747
// Include the source maps for Blockly for easier debugging Blockly code.
4848
config.module.rules.push({
49-
test: /(blockly\/.*\.js)$/,
49+
test: /(blockly[/\\].*\.js)$/,
5050
use: [require.resolve('source-map-loader')],
5151
enforce: 'pre',
5252
});
5353

5454
// Ignore spurious warnings from source-map-loader
5555
// It can't find source maps for some Closure modules and that is expected
56-
config.ignoreWarnings = [/Failed to parse source map/];
56+
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
5757
}
5858
return config;
5959
};

examples/keyboard-navigation-codelab/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module.exports = (env, argv) => {
4646

4747
// Include the source maps for Blockly for easier debugging Blockly code.
4848
config.module.rules.push({
49-
test: /(blockly\/.*\.js)$/,
49+
test: /(blockly[/\\].*\.js)$/,
5050
use: [require.resolve('source-map-loader')],
5151
enforce: 'pre',
5252
});
5353

5454
// Ignore spurious warnings from source-map-loader
5555
// It can't find source maps for some Closure modules and that is expected
56-
config.ignoreWarnings = [/Failed to parse source map/];
56+
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
5757
}
5858
return config;
5959
};

examples/sample-app-ts/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ module.exports = (env, argv) => {
5454

5555
// Include the source maps for Blockly for easier debugging Blockly code.
5656
config.module.rules.push({
57-
test: /(blockly\/.*\.js)$/,
57+
test: /(blockly[/\\].*\.js)$/,
5858
use: [require.resolve('source-map-loader')],
5959
enforce: 'pre',
6060
});
6161

6262
// Ignore spurious warnings from source-map-loader
6363
// It can't find source maps for some Closure modules and that is expected
64-
config.ignoreWarnings = [/Failed to parse source map/];
64+
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
6565
}
6666
return config;
6767
};

examples/sample-app/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ module.exports = (env, argv) => {
4646

4747
// Include the source maps for Blockly for easier debugging Blockly code.
4848
config.module.rules.push({
49-
test: /(blockly\/.*\.js)$/,
49+
test: /(blockly[/\\].*\.js)$/,
5050
use: [require.resolve('source-map-loader')],
5151
enforce: 'pre',
5252
});
5353

5454
// Ignore spurious warnings from source-map-loader
5555
// It can't find source maps for some Closure modules and that is expected
56-
config.ignoreWarnings = [/Failed to parse source map/];
56+
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
5757
}
5858
return config;
5959
};

plugins/dev-scripts/config/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module.exports = (env) => {
107107
rules: [
108108
// Load Blockly source maps.
109109
{
110-
test: /(blockly\/.*\.js)$/,
110+
test: /(blockly[/\\].*\.js)$/,
111111
use: [require.resolve('source-map-loader')],
112112
enforce: 'pre',
113113
},
@@ -119,7 +119,7 @@ module.exports = (env) => {
119119
},
120120
// Ignore spurious warnings from source-map-loader
121121
// It can't find source maps for some Closure modules and that is expected
122-
ignoreWarnings: [/Failed to parse source map/],
122+
ignoreWarnings: [/Failed to parse source map.*blockly/],
123123
plugins,
124124
externals: isProduction
125125
? {

0 commit comments

Comments
 (0)