Moved config files to a separate folder

This commit is contained in:
Jori Lallo
2018-01-03 16:58:34 -08:00
parent 686c237e36
commit 7a7f8f7c53
6 changed files with 13 additions and 15 deletions

View File

@ -32,8 +32,8 @@ module.exports = {
test: /\.js$/, test: /\.js$/,
loader: 'babel-loader', loader: 'babel-loader',
include: [ include: [
path.join(__dirname, 'app'), path.join(__dirname, '../app'),
path.join(__dirname, 'shared'), path.join(__dirname, '../shared'),
], ],
}, },
{ test: /\.json$/, loader: 'json-loader' }, { test: /\.json$/, loader: 'json-loader' },
@ -57,11 +57,11 @@ module.exports = {
}, },
resolve: { resolve: {
modules: [ modules: [
path.resolve(__dirname, 'app'), path.resolve(__dirname, '../app'),
'node_modules' 'node_modules'
], ],
alias: { alias: {
shared: path.resolve(__dirname, 'shared'), shared: path.resolve(__dirname, '../shared'),
'boundless-utils-omit-keys': 'boundless-utils-omit-keys/build', 'boundless-utils-omit-keys': 'boundless-utils-omit-keys/build',
'boundless-utils-uuid': 'boundless-utils-uuid/build' 'boundless-utils-uuid': 'boundless-utils-uuid/build'
} }

View File

@ -3,7 +3,7 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonWebpackConfig = require('./webpack.config'); const commonWebpackConfig = require('./webpack.base');
const developmentWebpackConfig = Object.assign(commonWebpackConfig, { const developmentWebpackConfig = Object.assign(commonWebpackConfig, {
cache: true, cache: true,

View File

@ -4,14 +4,14 @@ var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin'); var ExtractTextPlugin = require('extract-text-webpack-plugin');
commonWebpackConfig = require('./webpack.config'); commonWebpackConfig = require('./webpack.base');
productionWebpackConfig = Object.assign(commonWebpackConfig, { productionWebpackConfig = Object.assign(commonWebpackConfig, {
cache: true, cache: true,
devtool: 'source-map', devtool: 'source-map',
entry: ['babel-polyfill', 'babel-regenerator-runtime', './app/index'], entry: ['babel-polyfill', 'babel-regenerator-runtime', './app/index'],
output: { output: {
path: path.join(__dirname, 'dist'), path: path.join(__dirname, '../dist'),
filename: 'bundle.[hash].js', filename: 'bundle.[hash].js',
publicPath: '/static/', publicPath: '/static/',
}, },
@ -26,9 +26,7 @@ productionWebpackConfig.plugins.push(
); );
productionWebpackConfig.plugins.push( productionWebpackConfig.plugins.push(
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { sourceMap: true,
sourceMap: true,
},
}) })
); );
productionWebpackConfig.plugins.push( productionWebpackConfig.plugins.push(

View File

@ -4,8 +4,8 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"clean": "rimraf dist", "clean": "rimraf dist",
"build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js", "build:webpack": "NODE_ENV=production webpack --config config/webpack.prod.js",
"build:analyze": "NODE_ENV=production webpack --config webpack.config.prod.js --json | webpack-bundle-size-analyzer", "build:analyze": "NODE_ENV=production webpack --config config/webpack.prod.js --json | webpack-bundle-size-analyzer",
"build": "npm run clean && npm run build:webpack", "build": "npm run clean && npm run build:webpack",
"start": "NODE_ENV=production node index.js", "start": "NODE_ENV=production node index.js",
"dev": "NODE_ENV=development nodemon --watch server index.js", "dev": "NODE_ENV=development nodemon --watch server index.js",
@ -49,7 +49,7 @@
], ],
"setupFiles": [ "setupFiles": [
"raf/polyfill", "raf/polyfill",
"<rootDir>/setupJest.js", "<rootDir>/config/setupJest.js",
"<rootDir>/__mocks__/window.js" "<rootDir>/__mocks__/window.js"
] ]
}, },
@ -202,4 +202,4 @@
"raf": "^3.4.0", "raf": "^3.4.0",
"react-test-renderer": "^16.1.0" "react-test-renderer": "^16.1.0"
} }
} }

View File

@ -21,7 +21,7 @@ if (process.env.NODE_ENV === 'development') {
const webpack = require('webpack'); const webpack = require('webpack');
const devMiddleware = require('koa-webpack-dev-middleware'); const devMiddleware = require('koa-webpack-dev-middleware');
const hotMiddleware = require('koa-webpack-hot-middleware'); const hotMiddleware = require('koa-webpack-hot-middleware');
const config = require('../webpack.config.dev'); const config = require('../config/webpack.dev');
const compile = webpack(config); const compile = webpack(config);
/* eslint-enable global-require */ /* eslint-enable global-require */