Skip to content

Commit

Permalink
DEP Upgrade webpack config and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Dec 8, 2022
1 parent 85acb77 commit 2536fde
Show file tree
Hide file tree
Showing 4 changed files with 8,529 additions and 8,478 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
18
74 changes: 37 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"author": "SilverStripe Ltd",
"engines": {
"node": "^10.x"
"node": "^18.x"
},
"scripts": {
"build": "yarn && yarn lint && yarn test && NODE_ENV=production webpack -p --bail --progress",
Expand Down Expand Up @@ -48,52 +48,52 @@
}
},
"devDependencies": {
"@silverstripe/eslint-config": "^0.1.0",
"@silverstripe/webpack-config": "^1.5.0",
"@storybook/addon-actions": "^3.4.11",
"@storybook/addons": "^3.4.11",
"@storybook/react": "^3.4.11",
"babel-jest": "^23.6.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"jest-cli": "^23.6.0",
"webpack": "^2.6.0"
"@silverstripe/eslint-config": "file:/home/gsartorelli/dump/eslint-config",
"@silverstripe/webpack-config": "file:/home/gsartorelli/dump/webpack-config",
"@storybook/addon-actions": "^6.5.13",
"@storybook/addons": "^6.5.13",
"@storybook/react": "^6.5.13",
"babel-jest": "^29.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.7",
"jest-cli": "^29.3.0",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"dependencies": {
"apollo-client": "^2.4.2",
"babel-polyfill": "6.7.4",
"bootstrap": "^4.3.1",
"classnames": "^2.2.5",
"graphql": "^14.0.0",
"@apollo/client": "^3.7.1",
"@popperjs/core": "^2.11.6",
"bootstrap": "^4.6.2",
"classnames": "^2.3.2",
"core-js": "^3.26.0",
"create-react-class": "^15.7.0",
"graphql": "^16.6.0",
"graphql-fragments": "^0.1.0",
"graphql-tag": "^2.10.0",
"graphql-tag": "^2.12.6",
"griddle-react": "^0.8.2",
"jquery": "^3.5.0",
"moment": "^2.21.0",
"popper.js": "^1.14.4",
"prop-types": "^15.6.2",
"qs": "^6.1.0",
"react": "^16.6.1",
"react-apollo": "^2.1.11",
"react-dom": "^16.6.1",
"react-redux": "^4.4.5",
"react-router": "^3.0.0",
"react-router-redux": "^4.0.5",
"reactstrap": "^6.4.0",
"redux": "^3.3.1",
"moment": "^2.29.4",
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-router": "^6.4.3",
"react-router-redux": "^4.0.8",
"reactstrap": "^8.9.0",
"redux": "^4.2.0",
"url": "^0.11.0",
"uuid": "^3.2.1"
"uuid": "^9.0.0"
},
"resolutions": {
"colors": "1.1.2"
"colors": "1.4.0"
},
"browserslist": [
"defaults"
],
"babel": {
"presets": [
"env",
"react"
],
"plugins": [
"transform-object-rest-spread"
"@babel/preset-env",
"@babel/preset-react"
]
}
}
52 changes: 12 additions & 40 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
const Path = require('path');
const webpackConfig = require('@silverstripe/webpack-config');
const {
resolveJS,
externalJS,
moduleJS,
pluginJS,
moduleCSS,
pluginCSS,
} = webpackConfig;
const { JavascriptWebpackConfig, CssWebpackConfig } = require('@silverstripe/webpack-config');

const ENV = process.env.NODE_ENV;
const PATHS = {
MODULES: 'node_modules',
FILES_PATH: '../',
ROOT: Path.resolve(),
SRC: Path.resolve('client/src'),
DIST: Path.resolve('client/dist'),
};

const config = [
{
name: 'js',
entry: {
// Main JS bundle
new JavascriptWebpackConfig('js', PATHS, 'silverstripe/versioned-admin')
.setEntry({
bundle: `${PATHS.SRC}/bundles/bundle.js`,
},
output: {
path: PATHS.DIST,
filename: 'js/[name].js',
},
devtool: (ENV !== 'production') ? 'source-map' : '',
resolve: resolveJS(ENV, PATHS),
externals: externalJS(ENV, PATHS),
module: moduleJS(ENV, PATHS),
plugins: pluginJS(ENV, PATHS),
},
{
name: 'css',
entry: {
})
.getConfig(),
// sass to css
new CssWebpackConfig('css', PATHS)
.setEntry({
bundle: `${PATHS.SRC}/styles/bundle.scss`,
},
output: {
path: PATHS.DIST,
filename: 'styles/[name].css',
},
devtool: (ENV !== 'production') ? 'source-map' : '',
module: moduleCSS(ENV, PATHS),
plugins: pluginCSS(ENV, PATHS),
},
})
.getConfig(),
];

// Use WEBPACK_CHILD=js or WEBPACK_CHILD=css env var to run a single config
module.exports = (process.env.WEBPACK_CHILD)
? config.find((entry) => entry.name === process.env.WEBPACK_CHILD)
: module.exports = config;
: config;
Loading

0 comments on commit 2536fde

Please sign in to comment.