2018-01-28 23:46:54 +01:00
|
|
|
const Path = require('path');
|
2023-02-07 01:35:34 +01:00
|
|
|
const { JavascriptWebpackConfig, CssWebpackConfig } = require('@silverstripe/webpack-config');
|
2018-01-28 23:46:54 +01:00
|
|
|
|
|
|
|
const ENV = process.env.NODE_ENV;
|
|
|
|
const PATHS = {
|
|
|
|
ROOT: Path.resolve(),
|
|
|
|
SRC: Path.resolve('client/src'),
|
|
|
|
DIST: Path.resolve('client/dist'),
|
|
|
|
};
|
|
|
|
|
|
|
|
const config = [
|
2023-02-07 01:35:34 +01:00
|
|
|
// Main JS bundle
|
|
|
|
new JavascriptWebpackConfig('js', PATHS, 'silverstripe/blog')
|
|
|
|
.setEntry({
|
|
|
|
main: `${PATHS.SRC}/main.js`
|
|
|
|
})
|
|
|
|
.mergeConfig({
|
|
|
|
output: {
|
|
|
|
filename: 'js/[name].bundle.js',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.getConfig(),
|
|
|
|
// sass to css
|
|
|
|
new CssWebpackConfig('css', PATHS)
|
|
|
|
.setEntry({
|
|
|
|
main: `${PATHS.SRC}/main.scss`
|
|
|
|
})
|
|
|
|
.getConfig(),
|
2018-01-28 23:46:54 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
module.exports = config;
|