Skip to content

Commit 662804a

Browse files
Updated webpack
1 parent f77ea6f commit 662804a

File tree

3 files changed

+1047
-1738
lines changed

3 files changed

+1047
-1738
lines changed

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@
2727
"jest-puppeteer": "^4.4.0",
2828
"pdfkit-nodejs-webpack": "^0.0.2",
2929
"puppeteer": "^5.5.0",
30+
"stream-browserify": "^3.0.0",
3031
"style-loader": "^2.0.0",
3132
"url-loader": "^4.1.1",
32-
"webpack": "^4.46.0",
33-
"webpack-cli": "^4.7.2",
34-
"webpack-dev-server": "^3.11.1"
33+
"util": "^0.12.5",
34+
"webpack": "^5.85.0",
35+
"webpack-cli": "^5.1.3",
36+
"webpack-dev-server": "^4.15.0",
37+
"process": "^0.11.10"
3538
},
3639
"scripts": {
3740
"test": "jest",

webpack.config.js

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
const HtmlWebPackPlugin = require('html-webpack-plugin')
2-
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
1+
const HtmlWebPackPlugin = require('html-webpack-plugin');
2+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
3+
const webpack = require('webpack');
34
var path = require("path");
45
const options = { };
56

@@ -12,7 +13,7 @@ module.exports = {
1213
"interactivetests": "./samples/javascript.controls/common/tests.js",
1314
},
1415
devServer: {
15-
contentBase: './',
16+
static: './',
1617
hot: true,
1718
port: 8080
1819
},
@@ -54,17 +55,25 @@ module.exports = {
5455
],
5556
},
5657
resolve: {
57-
extensions: ['.js', '.scss']
58+
extensions: ['.js', '.scss'],
59+
fallback: {
60+
stream: require.resolve('stream-browserify'),
61+
util: require.resolve('util/')
62+
}
5863
},
5964
plugins: [
60-
new CleanWebpackPlugin(),
61-
// new HtmlWebPackPlugin({
62-
// template: './*.html',
63-
// filename: './*.html'
64-
// }),
65-
// new HtmlWebPackPlugin({
66-
// template: './photos.html',
67-
// filename: './photos.html'
68-
// })
65+
new CleanWebpackPlugin(),
66+
// fix "process is not defined" error:
67+
new webpack.ProvidePlugin({
68+
process: 'process/browser',
69+
}),
70+
// new HtmlWebPackPlugin({
71+
// template: './*.html',
72+
// filename: './*.html'
73+
// }),
74+
// new HtmlWebPackPlugin({
75+
// template: './photos.html',
76+
// filename: './photos.html'
77+
// })
6978
]
7079
};

0 commit comments

Comments
 (0)