Simplify build files

Former-commit-id: a0a4589357862c2bd083e9f84cc234ef9ecdf2b6 [formerly ee8797966d10488dd8375fca7f682c80e5f21ef1] [formerly 116a13d907cea4a53448fbcd3e075aa8890b423f [formerly 9adada30674717ca76431dea10501606b38ab46f]]
Former-commit-id: 9993fa98d9ea12dac215eb90f9550682118c6728 [formerly da641e3ed83bb471d31c95f2a324fd05901b33a8]
Former-commit-id: 1322b5880b009ec6ade22255dec3d145f480209e
This commit is contained in:
Henrique Dias
2017-06-28 19:09:32 +01:00
parent c3c6c8f3d6
commit 1f1b47f77e
9 changed files with 12 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var config = require('./config')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')

36
_assets/build/config.js Normal file
View File

@@ -0,0 +1,36 @@
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: {
NODE_ENV: '"production"'
},
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: {
NODE_ENV: '"development"'
},
index: path.resolve(__dirname, '../dist_dev/templates/index.html'),
assetsRoot: path.resolve(__dirname, '../dist_dev/'),
assetsSubDirectory: '_',
assetsPublicPath: '{{ .BaseURL }}',
produceSourceMap: true
}
}

View File

@@ -6,7 +6,7 @@ var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var config = require('./config')
var webpackConfig = require('./webpack.dev.conf')
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {

View File

@@ -1,5 +1,5 @@
var path = require('path')
var config = require('../config')
var config = require('./config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {

View File

@@ -1,5 +1,5 @@
var utils = require('./utils')
var config = require('../config')
var config = require('./config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {

View File

@@ -1,6 +1,6 @@
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var config = require('./config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {

View File

@@ -2,7 +2,7 @@ var fs = require('fs')
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var config = require('./config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')