Skip to content

Commit

Permalink
fix: Modify Webpack sourcemap parameters to account for Windows path …
Browse files Browse the repository at this point in the history
…separators (#2465)
  • Loading branch information
Varriount authored Nov 1, 2024
1 parent 759d71b commit 58be365
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/custom-generator-codelab/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ module.exports = (env, argv) => {

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

// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
config.ignoreWarnings = [/Failed to parse source map/];
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
}
return config;
};
4 changes: 2 additions & 2 deletions examples/custom-renderer-codelab/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ module.exports = (env, argv) => {

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

// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
config.ignoreWarnings = [/Failed to parse source map/];
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
}
return config;
};
4 changes: 2 additions & 2 deletions examples/keyboard-navigation-codelab/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ module.exports = (env, argv) => {

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

// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
config.ignoreWarnings = [/Failed to parse source map/];
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
}
return config;
};
4 changes: 2 additions & 2 deletions examples/sample-app-ts/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ module.exports = (env, argv) => {

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

// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
config.ignoreWarnings = [/Failed to parse source map/];
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
}
return config;
};
4 changes: 2 additions & 2 deletions examples/sample-app/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ module.exports = (env, argv) => {

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

// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
config.ignoreWarnings = [/Failed to parse source map/];
config.ignoreWarnings = [/Failed to parse source map.*blockly/];
}
return config;
};
4 changes: 2 additions & 2 deletions plugins/dev-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ module.exports = (env) => {
rules: [
// Load Blockly source maps.
{
test: /(blockly\/.*\.js)$/,
test: /(blockly[/\\].*\.js)$/,
use: [require.resolve('source-map-loader')],
enforce: 'pre',
},
Expand All @@ -119,7 +119,7 @@ module.exports = (env) => {
},
// Ignore spurious warnings from source-map-loader
// It can't find source maps for some Closure modules and that is expected
ignoreWarnings: [/Failed to parse source map/],
ignoreWarnings: [/Failed to parse source map.*blockly/],
plugins,
externals: isProduction
? {
Expand Down

0 comments on commit 58be365

Please sign in to comment.