Skip to content

Instantly share code, notes, and snippets.

@vertcitron
Created October 31, 2018 22:39
Show Gist options
  • Save vertcitron/0b4b779d9ba1a4de972f0a5232c5ac5b to your computer and use it in GitHub Desktop.
Save vertcitron/0b4b779d9ba1a4de972f0a5232c5ac5b to your computer and use it in GitHub Desktop.
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { execSync } = require('child_process')
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_GIT_BRANCH = process.env.CI_BRANCH || execSync('git rev-parse --abbrev-ref HEAD').toString('utf8').trim()
module.exports = {
outputDir: 'public',
assetsDir: 'static',
runtimeCompiler: true,
pluginOptions: {
'style-resources-loader': {
preProcessor: 'scss',
patterns: [
path.resolve(__dirname, 'src/assets/style/variables.scss')
]
}
},
configureWebpack: {
resolve: {
alias: require('./aliases.config').webpack
},
plugins: [
new CopyWebpackPlugin([{
from: path.join(__dirname, 'template'),
to: path.join(__dirname, 'public'),
toType: "dir",
ignore: [ "index.html", ".DS_Store" ]
}])
]
},
chainWebpack: config => {
config.plugin("html")
.tap(args => {
args[0].template = path.join(__dirname,"template/index.html");
return args;
})
},
css: {
// Enable CSS source maps.
sourceMap: true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment