Skip to content

Commit

Permalink
✨ add definePlugin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti committed Jun 28, 2019
1 parent cc57557 commit d769aaf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ module.exports = {
envPath: '.env',
serverActiveEnv: 'NODE_ACTIVE=TRUE',
serverInactiveEnv: 'NODE_ACTIVE=FALSE',
// more info on definePlugin: https://webpack.js.org/plugins/define-plugin/
definePlugin: {
BOOLEAN_ENV: !!process.env.BOOLEAN_ENV,
STRING_ENV: JSON.stringify(process.env.STRING_ENV),
},
webpackConfig: {},
}
````
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (env, argv) => {
}),
new StyleLintPlugin(partialConfig.plugins.stylelint(autoFix)),
new VueLoaderPlugin(),
new webpack.DefinePlugin(partialConfig.plugins.define),
new webpack.DefinePlugin(settings.definePlugin || {}),
],
}, settings.webpackConfig || {});

Expand Down
2 changes: 1 addition & 1 deletion webpack.hmr.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = (env, argv) => {
plugins: [
new StyleLintPlugin(partialConfig.plugins.stylelint(autoFix)),
new VueLoaderPlugin(),
new webpack.DefinePlugin(partialConfig.plugins.define),
new webpack.DefinePlugin(settings.definePlugin || {}),
],
}, settings.webpackConfig || {});

Expand Down
3 changes: 0 additions & 3 deletions webpack.partial.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ module.exports = (runDirectory, settings) => ({
files: settings.directory.scss.replace(/(\/)$/g, '') + '/**/*.{vue-scss,vue,htm,html,css,sss,less,scss,sass}',
fix: autoFix,
}),
define: {
EXECUTE_SENTRY: !!process.env.EXECUTE_SENTRY,
},
},
rules: {
vue: {
Expand Down

0 comments on commit d769aaf

Please sign in to comment.