Skip to content

Commit 1884b4e

Browse files
committed
Update webpack & co.
1 parent 23a0973 commit 1884b4e

File tree

4 files changed

+25
-33
lines changed

4 files changed

+25
-33
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!doctype>
22
<html>
33
<head>
4-
<title>my-dash-component</title>
4+
<title>{{ cookiecutter.project_shortname }}</title>
55
</head>
66
<body>
77
<div id='root'></div>
8-
<script src="/{{ cookiecutter.project_shortname }}/output.js"></script>
8+
<script src="/output.js"></script>
99
</body>
1010
</html>

{{cookiecutter.project_shortname}}/package.json

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{%- endif %}
1515
"main": "build/index.js",
1616
"scripts": {
17-
"start": "webpack-serve --config ./webpack.serve.config.js --open",
17+
"start": "webpack serve --config ./webpack.serve.config.js --open",
1818
"validate-init": "python _validate_init.py",
1919
"prepublishOnly": "npm run validate-init",
2020
"build:js": "webpack --mode production",
@@ -29,30 +29,29 @@
2929
"ramda": "^0.26.1"
3030
},
3131
"devDependencies": {
32-
"@babel/core": "^7.5.4",
33-
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
34-
"@babel/preset-env": "^7.5.4",
35-
"@babel/preset-react": "^7.0.0",
32+
"@babel/core": "^7.22.1",
33+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
34+
"@babel/preset-env": "^7.22.2",
35+
"@babel/preset-react": "^7.22.3",
36+
"@plotly/dash-component-plugins": "^1.2.3",
3637
"@plotly/webpack-dash-dynamic-import": "^1.2.0",
37-
"@plotly/dash-component-plugins": "^1.2.0",
38-
"babel-eslint": "^10.0.2",
39-
"babel-loader": "^8.0.6",
38+
"babel-eslint": "^10.1.0",
39+
"babel-loader": "^9.1.2",
4040
"copyfiles": "^2.1.1",
41-
"css-loader": "^3.0.0",
41+
"css-loader": "^6.8.1",
4242
"eslint": "^6.0.1",
4343
"eslint-config-prettier": "^6.0.0",
4444
"eslint-plugin-import": "^2.18.0",
4545
"eslint-plugin-react": "^7.14.2",
46-
"prop-types": "^15.7.2",
46+
"prop-types": "^15.8.1",
4747
"react": "^16.8.6",
48-
"react-docgen": "^4.1.1",
48+
"react-docgen": "^5.4.3",
4949
"react-dom": "^16.8.6",
50-
"styled-jsx": "^3.2.1",
5150
"style-loader": "^0.23.1",
52-
"terser-webpack-plugin": "^2.3.0",
53-
"webpack": "4.36.1",
54-
"webpack-cli": "3.3.6",
55-
"webpack-serve": "3.1.0"
51+
"styled-jsx": "^3.2.1",
52+
"webpack": "5.84.1",
53+
"webpack-cli": "5.1.1",
54+
"webpack-dev-server": "^4.15.0"
5655
},
5756
"engines": {
5857
"node": ">=8.11.0",

{{cookiecutter.project_shortname}}/src/demo/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { {{cookiecutter.component_name}} } from '../lib';
55

66
class App extends Component {
77

8-
constructor() {
9-
super();
8+
constructor(props) {
9+
super(props);
1010
this.state = {
1111
value: ''
1212
};

{{cookiecutter.project_shortname}}/webpack.config.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const path = require('path');
2-
const TerserPlugin = require('terser-webpack-plugin');
32
const webpack = require('webpack');
43
const WebpackDashDynamicImport = require('@plotly/webpack-dash-dynamic-import');
54
const packagejson = require('./package.json');
@@ -55,6 +54,11 @@ module.exports = (env, argv) => {
5554
libraryTarget: 'window',
5655
},
5756
devtool,
57+
devServer: {
58+
static: {
59+
directory: path.join(__dirname, '/')
60+
}
61+
},
5862
externals,
5963
module: {
6064
rules: [
@@ -82,19 +86,8 @@ module.exports = (env, argv) => {
8286
],
8387
},
8488
optimization: {
85-
minimizer: [
86-
new TerserPlugin({
87-
sourceMap: true,
88-
parallel: true,
89-
cache: './.build_cache/terser',
90-
terserOptions: {
91-
warnings: false,
92-
ie8: false
93-
}
94-
})
95-
],
9689
splitChunks: {
97-
name: true,
90+
name: '[name].js',
9891
cacheGroups: {
9992
async: {
10093
chunks: 'async',

0 commit comments

Comments
 (0)