-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* DEP Update webpack config and deps * DEP Update code to work with upgraded deps * MNT Run yarn build
- Loading branch information
1 parent
5eee11f
commit e6b4979
Showing
7 changed files
with
4,796 additions
and
4,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,18 @@ | ||
const Path = require('path'); | ||
const webpackConfig = require('@silverstripe/webpack-config'); | ||
const { JavascriptWebpackConfig } = require('@silverstripe/webpack-config'); | ||
|
||
const { | ||
resolveJS, | ||
externalJS, | ||
moduleJS, | ||
pluginJS, | ||
} = webpackConfig; | ||
|
||
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'), | ||
LEGACY_SRC: Path.resolve('client/src'), | ||
}; | ||
|
||
const config = [ | ||
{ | ||
name: 'js', | ||
entry: { | ||
legacy: `${PATHS.LEGACY_SRC}/bundles/legacy.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), | ||
}, | ||
// Main JS bundle | ||
new JavascriptWebpackConfig('js', PATHS, 'silverstripe/frameworktest') | ||
.setEntry({ | ||
legacy: `${PATHS.SRC}/bundles/legacy.js`, | ||
}) | ||
.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; | ||
module.exports = config; |
Oops, something went wrong.