Permalink
Browse files

Add production build target. HFP-987

  • Loading branch information...
tajakobsen committed Apr 24, 2017
1 parent 2fe25af commit e4b1d5d4bf97b87572c79f90dae1c53333ad3bcc
Showing with 15 additions and 5 deletions.
  1. +1 −1 README.md
  2. +2 −1 package.json
  3. +12 −3 webpack.config.js
View
@@ -8,7 +8,7 @@ Grab all the modules:
npm install
```
Build project:
Build project for production:
```bash
npm run build
View
@@ -4,7 +4,7 @@
"description": "H5P content type for recording audio",
"scripts": {
"test": "ava",
"build": "webpack",
"build": "cross-env NODE_ENV='production' webpack -p",
"watch": "webpack --watch"
},
"repository": {
@@ -21,6 +21,7 @@
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-latest": "^6.22.0",
"cross-env": "^4.0.0",
"css-loader": "^0.26.2",
"extract-text-webpack-plugin": "^2.0.0",
"node-sass": "^4.5.2",
View
@@ -1,4 +1,5 @@
var path = require('path');
const path = require('path');
const webpack = require('webpack');
const config = {
entry: "./src/entries/dist.js",
@@ -10,7 +11,7 @@ const config = {
},
resolve: {
alias: {
vue: 'vue/dist/vue.js'
'vue$': 'vue/dist/vue.esm.js'
},
modules: [
path.resolve('./src'),
@@ -43,7 +44,15 @@ const config = {
loader: 'url-loader?limit=10000'
} // inline base64 URLs for <=10k images, direct URLs for the rest
]
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
}),
]
};
module.exports = config;

0 comments on commit e4b1d5d

Please sign in to comment.