mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
30 lines
831 B
JavaScript
30 lines
831 B
JavaScript
const Path = require('path');
|
|
const { JavascriptWebpackConfig, CssWebpackConfig } = require('@silverstripe/webpack-config');
|
|
|
|
const ENV = process.env.NODE_ENV;
|
|
const PATHS = {
|
|
ROOT: Path.resolve(),
|
|
SRC: Path.resolve('client/src'),
|
|
DIST: Path.resolve('client/dist'),
|
|
};
|
|
|
|
const config = [
|
|
// Main JS bundle
|
|
new JavascriptWebpackConfig('js', PATHS, 'colymba/gridfield-bulk-editing-tools')
|
|
.setEntry({
|
|
main: `${PATHS.SRC}/bundles/bundle.js`,
|
|
})
|
|
.getConfig(),
|
|
// sass to css
|
|
new CssWebpackConfig('css', PATHS)
|
|
.setEntry({
|
|
main: `${PATHS.SRC}/styles/bundle.scss`,
|
|
})
|
|
.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)
|
|
: config;
|