mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API added watch command to package.json
This commit is contained in:
parent
a08a854c9c
commit
2f4867fef8
@ -11,6 +11,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build": "webpack",
|
||||||
|
"watch": "webpack --config ./webpack-dev.config.js --watch",
|
||||||
"css": "WEBPACK_CHILD=css webpack",
|
"css": "WEBPACK_CHILD=css webpack",
|
||||||
"lock": "npm-shrinkwrap --dev",
|
"lock": "npm-shrinkwrap --dev",
|
||||||
"test": "NODE_PATH=\"./client/src:./admin/client/src\" jest",
|
"test": "NODE_PATH=\"./client/src:./admin/client/src\" jest",
|
||||||
|
25
webpack-dev.config.js
Normal file
25
webpack-dev.config.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
const webpack = require('webpack');
|
||||||
|
const Config = require('./webpack.config');
|
||||||
|
|
||||||
|
if (Array.isArray(Config)) {
|
||||||
|
const jsConfig = Config.find((item) => item.name === 'js');
|
||||||
|
|
||||||
|
jsConfig.plugins = [
|
||||||
|
new webpack.ProvidePlugin({
|
||||||
|
jQuery: 'jQuery',
|
||||||
|
$: 'jQuery',
|
||||||
|
}),
|
||||||
|
// Most vendor libs are loaded directly into the 'vendor' bundle (through require() calls in vendor.js).
|
||||||
|
// This ensures that any further require() calls in other bundles aren't duplicating libs.
|
||||||
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
|
name: 'vendor',
|
||||||
|
minChunks: Infinity,
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
for (var i = 0; i < Config.length; i++) {
|
||||||
|
Config[i].devtool = 'source-map';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Config;
|
@ -88,7 +88,6 @@ const config = [
|
|||||||
config: 'Config',
|
config: 'Config',
|
||||||
'lib/Router': 'Router',
|
'lib/Router': 'Router',
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
@ -152,7 +151,6 @@ const config = [
|
|||||||
path: 'admin/client/dist',
|
path: 'admin/client/dist',
|
||||||
filename: '[name].css',
|
filename: '[name].css',
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
@ -202,7 +200,6 @@ const config = [
|
|||||||
path: './',
|
path: './',
|
||||||
filename: '[name].css',
|
filename: '[name].css',
|
||||||
},
|
},
|
||||||
devtool: 'source-map',
|
|
||||||
module: {
|
module: {
|
||||||
loaders: [
|
loaders: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user