Simplify build files
parent
b214fdd0eb
commit
9adada3067
|
@ -7,7 +7,7 @@ var rm = require('rimraf')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var chalk = require('chalk')
|
var chalk = require('chalk')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var webpackConfig = require('./webpack.prod.conf')
|
var webpackConfig = require('./webpack.prod.conf')
|
||||||
|
|
||||||
var spinner = ora('building for production...')
|
var spinner = ora('building for production...')
|
||||||
|
|
|
@ -3,7 +3,9 @@ var path = require('path')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
build: {
|
build: {
|
||||||
env: require('./prod.env'),
|
env: {
|
||||||
|
NODE_ENV: '"production"'
|
||||||
|
},
|
||||||
index: path.resolve(__dirname, '../dist/index.html'),
|
index: path.resolve(__dirname, '../dist/index.html'),
|
||||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||||
assetsSubDirectory: 'static',
|
assetsSubDirectory: 'static',
|
||||||
|
@ -22,7 +24,9 @@ module.exports = {
|
||||||
bundleAnalyzerReport: process.env.npm_config_report
|
bundleAnalyzerReport: process.env.npm_config_report
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
env: require('./dev.env'),
|
env: {
|
||||||
|
NODE_ENV: '"development"'
|
||||||
|
},
|
||||||
index: path.resolve(__dirname, '../dist_dev/templates/index.html'),
|
index: path.resolve(__dirname, '../dist_dev/templates/index.html'),
|
||||||
assetsRoot: path.resolve(__dirname, '../dist_dev/'),
|
assetsRoot: path.resolve(__dirname, '../dist_dev/'),
|
||||||
assetsSubDirectory: '_',
|
assetsSubDirectory: '_',
|
|
@ -6,7 +6,7 @@ var rm = require('rimraf')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var chalk = require('chalk')
|
var chalk = require('chalk')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var webpackConfig = require('./webpack.dev.conf')
|
var webpackConfig = require('./webpack.dev.conf')
|
||||||
|
|
||||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
var ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
|
|
||||||
exports.assetsPath = function (_path) {
|
exports.assetsPath = function (_path) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var isProduction = process.env.NODE_ENV === 'production'
|
var isProduction = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var vueLoaderConfig = require('./vue-loader.conf')
|
var vueLoaderConfig = require('./vue-loader.conf')
|
||||||
|
|
||||||
function resolve (dir) {
|
function resolve (dir) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ var fs = require('fs')
|
||||||
var path = require('path')
|
var path = require('path')
|
||||||
var utils = require('./utils')
|
var utils = require('./utils')
|
||||||
var webpack = require('webpack')
|
var webpack = require('webpack')
|
||||||
var config = require('../config')
|
var config = require('./config')
|
||||||
var merge = require('webpack-merge')
|
var merge = require('webpack-merge')
|
||||||
var baseWebpackConfig = require('./webpack.base.conf')
|
var baseWebpackConfig = require('./webpack.base.conf')
|
||||||
var CopyWebpackPlugin = require('copy-webpack-plugin')
|
var CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
var merge = require('webpack-merge')
|
|
||||||
var prodEnv = require('./prod.env')
|
|
||||||
|
|
||||||
module.exports = merge(prodEnv, {
|
|
||||||
NODE_ENV: '"development"'
|
|
||||||
})
|
|
|
@ -1,3 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
NODE_ENV: '"production"'
|
|
||||||
}
|
|
Loading…
Reference in New Issue