Skip to content

Commit

Permalink
Update webpack, and test Webpack 4
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 9, 2020
1 parent e934f1b commit abff979
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 937 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [10.x, 12.x, 14.x, 15.x]
webpack-version: [latest, next]
webpack-version: [latest, '4']
include:
- node: 14.x
os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"react-intl-webpack-plugin": "^0.3.0",
"rimraf": "^3.0.0",
"semver": "7.3.2",
"webpack": "^4.0.0"
"webpack": "^5.4.0"
},
"scripts": {
"clean": "rimraf lib/",
Expand Down
15 changes: 9 additions & 6 deletions test/sourcemaps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ test.cb("should output webpack's devtoolModuleFilename option", t => {
devtool: "source-map",
output: {
path: t.context.directory,
devtoolModuleFilenameTemplate: "==[absolute-resource-path]==",
devtoolModuleFilenameTemplate: "=!=!=!=[absolute-resource-path]=!=!=!=",
},
module: {
rules: [
Expand Down Expand Up @@ -171,11 +171,14 @@ test.cb("should output webpack's devtoolModuleFilename option", t => {
t.is(err, null);

// The full absolute path is included in the sourcemap properly
t.not(
data
.toString()
.indexOf(JSON.stringify(`==${globalConfig.entry}==`)),
-1,
t.regex(
data.toString(),
new RegExp(
JSON.stringify(`=!=!=!=${globalConfig.entry}=!=!=!=`).replace(
/\\/g,
"\\\\",
),
),
);

t.end();
Expand Down
Loading

0 comments on commit abff979

Please sign in to comment.