Commit 25eb8d3d by liwk

commit

1 parent 8306ed6b
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
const titles = require('./title.js') const titles = require('./title.js')
const glob = require('glob') const glob = require('glob')
const pages = {} const pages = {}
const versions = Math.round(new Date() / 1000)
// const mode = process.env.NODE_ENV || 'development' // const mode = process.env.NODE_ENV || 'development'
glob.sync('./src/views/**/app.js').forEach(path => { glob.sync('./src/views/**/app.js').forEach(path => {
const chunk = path.split('./src/views/')[1].split('/app.js')[0] const chunk = path.split('./src/views/')[1].split('/app.js')[0]
...@@ -15,12 +16,26 @@ glob.sync('./src/views/**/app.js').forEach(path => { ...@@ -15,12 +16,26 @@ glob.sync('./src/views/**/app.js').forEach(path => {
const path = require('path') const path = require('path')
module.exports = { module.exports = {
pages, pages,
baseUrl: './',
chainWebpack: config => { chainWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.output.filename(`js/[name].${versions}.js`).end()
config.output.chunkFilename(`js/[name].${versions}.js`).end()
config.plugin('extract-css').tap(args => [{
filename: `css/[name].${versions}.css`,
chunkFilename: `css/[name].${versions}.css`
}])
config.devtool = "source-map"
}
config.resolve.symlinks(true);
config.plugins.delete('named-chunks') config.plugins.delete('named-chunks')
config.resolve.alias config.resolve.alias
.set('@a', path.resolve(__dirname, './src/assets')) .set('@a', path.resolve(__dirname, './src/assets'))
.set('@api', path.resolve(__dirname, './src/api')) .set('@api', path.resolve(__dirname, './src/api'))
}, },
configureWebpack: (config) => { configureWebpack: (config) => {
// config.devtool = (mode === 'development') ? 'inline-source-map' : false // config.devtool = (mode === 'development') ? 'inline-source-map' : false
// config.mode = mode // config.mode = mode
...@@ -40,5 +55,10 @@ module.exports = { ...@@ -40,5 +55,10 @@ module.exports = {
ws: false ws: false
} }
} }
} },
css: {
sourceMap: false
},
runtimeCompiler: true,
productionSourceMap: true
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!