Moved config files to a separate folder
This commit is contained in:
@ -32,8 +32,8 @@ module.exports = {
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [
|
||||
path.join(__dirname, 'app'),
|
||||
path.join(__dirname, 'shared'),
|
||||
path.join(__dirname, '../app'),
|
||||
path.join(__dirname, '../shared'),
|
||||
],
|
||||
},
|
||||
{ test: /\.json$/, loader: 'json-loader' },
|
||||
@ -57,11 +57,11 @@ module.exports = {
|
||||
},
|
||||
resolve: {
|
||||
modules: [
|
||||
path.resolve(__dirname, 'app'),
|
||||
path.resolve(__dirname, '../app'),
|
||||
'node_modules'
|
||||
],
|
||||
alias: {
|
||||
shared: path.resolve(__dirname, 'shared'),
|
||||
shared: path.resolve(__dirname, '../shared'),
|
||||
'boundless-utils-omit-keys': 'boundless-utils-omit-keys/build',
|
||||
'boundless-utils-uuid': 'boundless-utils-uuid/build'
|
||||
}
|
@ -3,7 +3,7 @@ var webpack = require('webpack');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
const commonWebpackConfig = require('./webpack.config');
|
||||
const commonWebpackConfig = require('./webpack.base');
|
||||
|
||||
const developmentWebpackConfig = Object.assign(commonWebpackConfig, {
|
||||
cache: true,
|
@ -4,14 +4,14 @@ var webpack = require('webpack');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
commonWebpackConfig = require('./webpack.config');
|
||||
commonWebpackConfig = require('./webpack.base');
|
||||
|
||||
productionWebpackConfig = Object.assign(commonWebpackConfig, {
|
||||
cache: true,
|
||||
devtool: 'source-map',
|
||||
entry: ['babel-polyfill', 'babel-regenerator-runtime', './app/index'],
|
||||
output: {
|
||||
path: path.join(__dirname, 'dist'),
|
||||
path: path.join(__dirname, '../dist'),
|
||||
filename: 'bundle.[hash].js',
|
||||
publicPath: '/static/',
|
||||
},
|
||||
@ -26,9 +26,7 @@ productionWebpackConfig.plugins.push(
|
||||
);
|
||||
productionWebpackConfig.plugins.push(
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
compress: {
|
||||
sourceMap: true,
|
||||
},
|
||||
sourceMap: true,
|
||||
})
|
||||
);
|
||||
productionWebpackConfig.plugins.push(
|
@ -4,8 +4,8 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js",
|
||||
"build:analyze": "NODE_ENV=production webpack --config webpack.config.prod.js --json | webpack-bundle-size-analyzer",
|
||||
"build:webpack": "NODE_ENV=production webpack --config config/webpack.prod.js",
|
||||
"build:analyze": "NODE_ENV=production webpack --config config/webpack.prod.js --json | webpack-bundle-size-analyzer",
|
||||
"build": "npm run clean && npm run build:webpack",
|
||||
"start": "NODE_ENV=production node index.js",
|
||||
"dev": "NODE_ENV=development nodemon --watch server index.js",
|
||||
@ -49,7 +49,7 @@
|
||||
],
|
||||
"setupFiles": [
|
||||
"raf/polyfill",
|
||||
"<rootDir>/setupJest.js",
|
||||
"<rootDir>/config/setupJest.js",
|
||||
"<rootDir>/__mocks__/window.js"
|
||||
]
|
||||
},
|
||||
@ -202,4 +202,4 @@
|
||||
"raf": "^3.4.0",
|
||||
"react-test-renderer": "^16.1.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ if (process.env.NODE_ENV === 'development') {
|
||||
const webpack = require('webpack');
|
||||
const devMiddleware = require('koa-webpack-dev-middleware');
|
||||
const hotMiddleware = require('koa-webpack-hot-middleware');
|
||||
const config = require('../webpack.config.dev');
|
||||
const config = require('../config/webpack.dev');
|
||||
const compile = webpack(config);
|
||||
/* eslint-enable global-require */
|
||||
|
||||
|
Reference in New Issue
Block a user