Skip to content

Commit

Permalink
Update webpack & co.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed May 29, 2023
1 parent 23a0973 commit 1884b4e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
4 changes: 2 additions & 2 deletions {{cookiecutter.project_shortname}}/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype>
<html>
<head>
<title>my-dash-component</title>
<title>{{ cookiecutter.project_shortname }}</title>
</head>
<body>
<div id='root'></div>
<script src="/{{ cookiecutter.project_shortname }}/output.js"></script>
<script src="/output.js"></script>
</body>
</html>
31 changes: 15 additions & 16 deletions {{cookiecutter.project_shortname}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{%- endif %}
"main": "build/index.js",
"scripts": {
"start": "webpack-serve --config ./webpack.serve.config.js --open",
"start": "webpack serve --config ./webpack.serve.config.js --open",
"validate-init": "python _validate_init.py",
"prepublishOnly": "npm run validate-init",
"build:js": "webpack --mode production",
Expand All @@ -29,30 +29,29 @@
"ramda": "^0.26.1"
},
"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/plugin-proposal-object-rest-spread": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"@babel/preset-react": "^7.0.0",
"@babel/core": "^7.22.1",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/preset-env": "^7.22.2",
"@babel/preset-react": "^7.22.3",
"@plotly/dash-component-plugins": "^1.2.3",
"@plotly/webpack-dash-dynamic-import": "^1.2.0",
"@plotly/dash-component-plugins": "^1.2.0",
"babel-eslint": "^10.0.2",
"babel-loader": "^8.0.6",
"babel-eslint": "^10.1.0",
"babel-loader": "^9.1.2",
"copyfiles": "^2.1.1",
"css-loader": "^3.0.0",
"css-loader": "^6.8.1",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-react": "^7.14.2",
"prop-types": "^15.7.2",
"prop-types": "^15.8.1",
"react": "^16.8.6",
"react-docgen": "^4.1.1",
"react-docgen": "^5.4.3",
"react-dom": "^16.8.6",
"styled-jsx": "^3.2.1",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^2.3.0",
"webpack": "4.36.1",
"webpack-cli": "3.3.6",
"webpack-serve": "3.1.0"
"styled-jsx": "^3.2.1",
"webpack": "5.84.1",
"webpack-cli": "5.1.1",
"webpack-dev-server": "^4.15.0"
},
"engines": {
"node": ">=8.11.0",
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_shortname}}/src/demo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { {{cookiecutter.component_name}} } from '../lib';

class App extends Component {

constructor() {
super();
constructor(props) {
super(props);
this.state = {
value: ''
};
Expand Down
19 changes: 6 additions & 13 deletions {{cookiecutter.project_shortname}}/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const webpack = require('webpack');
const WebpackDashDynamicImport = require('@plotly/webpack-dash-dynamic-import');
const packagejson = require('./package.json');
Expand Down Expand Up @@ -55,6 +54,11 @@ module.exports = (env, argv) => {
libraryTarget: 'window',
},
devtool,
devServer: {
static: {
directory: path.join(__dirname, '/')
}
},
externals,
module: {
rules: [
Expand Down Expand Up @@ -82,19 +86,8 @@ module.exports = (env, argv) => {
],
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
parallel: true,
cache: './.build_cache/terser',
terserOptions: {
warnings: false,
ie8: false
}
})
],
splitChunks: {
name: true,
name: '[name].js',
cacheGroups: {
async: {
chunks: 'async',
Expand Down

0 comments on commit 1884b4e

Please sign in to comment.