Merge pull request #1798 from oxyc/patch-1

Allow browser versions to be configured in config.json
This commit is contained in:
Ben Word
2017-01-11 16:02:42 -07:00
committed by GitHub
4 changed files with 12 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ const config = mergeWithConcat({
watcher: !!argv.watch,
},
watch: [],
browsers: [],
}, userConfig);
config.watch.push(`${path.basename(config.paths.assets)}/${config.copy}`);

View File

@@ -155,7 +155,7 @@ let webpackConfig = {
output: { path: config.paths.dist },
context: config.paths.assets,
postcss: [
autoprefixer({ browsers: ['last 2 versions', 'android 4', 'opera 12'] }),
autoprefixer({ browsers: config.browsers }),
],
},
}),

View File

@@ -11,7 +11,10 @@ module.exports = {
plugins: [
new OptimizeCssAssetsPlugin({
cssProcessor: cssnano,
cssProcessorOptions: { discardComments: { removeAll: true } },
cssProcessorOptions: {
discardComments: { removeAll: true },
autoprefixer: { browsers: config.browsers },
},
canPrint: true,
}),
new ImageminPlugin({

View File

@@ -15,5 +15,10 @@
"publicPath": "/app/themes/sage",
"devUrl": "http://example.dev",
"proxyUrl": "http://localhost:3000",
"cacheBusting": "[name]_[hash:8]"
"cacheBusting": "[name]_[hash:8]",
"browsers": [
"last 2 versions",
"android 4",
"opera 12"
]
}