Skip to content

Commit

Permalink
adds dev and prod configs
Browse files Browse the repository at this point in the history
  • Loading branch information
berkeleycole committed Jul 14, 2019
1 parent bda4162 commit 89d0bb3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/server/index.js",
"build": "webpack"
"build-prod": "webpack --config webpack.prod.js",
"build-dev": "webpack --config webpack.prod.js"
},
"keywords": [],
"author": "",
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js → webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const HtmlWebPackPlugin = require("html-webpack-plugin")

module.exports = {
entry: './src/client/index.js',
mode: 'development',
devtool: 'source-map',
module: {
rules: [
Expand Down
23 changes: 23 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebPackPlugin = require("html-webpack-plugin")

module.exports = {
entry: './src/client/index.js',
mode: 'production',
module: {
rules: [
{
test: '/\.js$/',
exclude: /node_modules/,
loader: "babel-loader"
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/client/views/index.html",
filename: "./index.html",
})
]
}

0 comments on commit 89d0bb3

Please sign in to comment.