2017-09-07 04:40:26 +02:00
|
|
|
const Path = require('path');
|
|
|
|
// Import the core config
|
|
|
|
const webpackConfig = require('@silverstripe/webpack-config');
|
|
|
|
const {
|
|
|
|
resolveJS,
|
|
|
|
externalJS,
|
|
|
|
moduleJS,
|
|
|
|
pluginJS,
|
|
|
|
moduleCSS,
|
|
|
|
pluginCSS,
|
|
|
|
} = 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'),
|
2017-09-13 03:37:13 +02:00
|
|
|
THIRDPARTY: Path.resolve('thirdparty'),
|
2017-09-07 04:40:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const config = [
|
|
|
|
{
|
|
|
|
name: 'js',
|
|
|
|
entry: {
|
|
|
|
contentreview: `${PATHS.SRC}/bundles/bundle.js`,
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: PATHS.DIST,
|
|
|
|
filename: 'js/[name].js',
|
|
|
|
},
|
|
|
|
devtool: (ENV !== 'production') ? 'source-map' : '',
|
|
|
|
resolve: resolveJS(ENV, PATHS),
|
2017-09-11 02:01:41 +02:00
|
|
|
externals: externalJS(ENV, PATHS),
|
2017-09-07 04:40:26 +02:00
|
|
|
module: moduleJS(ENV, PATHS),
|
|
|
|
plugins: pluginJS(ENV, PATHS),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'css',
|
|
|
|
entry: {
|
|
|
|
contentreview: `${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),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = config;
|