Webpack modifications

This commit is contained in:
Troplo 2021-04-10 16:34:51 +10:00
parent 9b8f478824
commit 122183496e
2 changed files with 38 additions and 41 deletions

View File

@ -1,7 +1,10 @@
const Dotenv = require('dotenv-webpack');
var WebpackAutoInject = require('webpack-auto-inject-version');
module.exports = {
devServer: {
proxy: 'http://localhost:23981'
proxy: 'http://localhost:23981',
disableHostCheck: true, // dev.kaverti.flowinity
},
publicPath: '/',
@ -9,7 +12,40 @@ module.exports = {
configureWebpack: {
plugins: [
new Dotenv()
new Dotenv(),
new WebpackAutoInject({
// specify the name of the tag in the outputed files eg
// bundle.js: [SHORT] Version: 0.13.36 ...
SHORT: 'Version: 1.0.0-prerelease5',
SILENT: false,
PACKAGE_JSON_PATH: './package.json',
PACKAGE_JSON_INDENT: 4,
components: {
AutoIncreaseVersion: true,
InjectAsComment: true,
InjectByTag: true
},
componentsOptions: {
AutoIncreaseVersion: {
runInWatchMode: false // it will increase version with every single build!
},
InjectAsComment: {
tag: 'Version: {version} - {date}',
dateFormat: 'h:MM:ss TT', // change timezone: `UTC:h:MM:ss` or `GMT:h:MM:ss`
multiLineCommentType: false, // use `/** */` instead of `//` as comment block
},
InjectByTag: {
fileRegex: /\.+/,
// regexp to find [AIV] tag inside html, if you tag contains unallowed characters you can adjust the regex
// but also you can change [AIV] tag to anything you want
AIVTagRegexp: /(\[AIV])(([a-zA-Z{} ,:;!()_@\-"'\\\/])+)(\[\/AIV])/g,
dateFormat: 'h:MM:ss TT'
}
},
LOGS_TEXT: {
AIS_START: 'Kaverti AIV started'
}
})
]
},

View File

@ -1,39 +0,0 @@
var WebpackAutoInject = require('webpack-auto-inject-version');
module.exports = {
plugins: [
new WebpackAutoInject({
// specify the name of the tag in the outputed files eg
// bundle.js: [SHORT] Version: 0.13.36 ...
SHORT: 'Version: 1.0.0-prerelease5',
SILENT: false,
PACKAGE_JSON_PATH: './package.json',
PACKAGE_JSON_INDENT: 4,
components: {
AutoIncreaseVersion: true,
InjectAsComment: true,
InjectByTag: true
},
componentsOptions: {
AutoIncreaseVersion: {
runInWatchMode: false // it will increase version with every single build!
},
InjectAsComment: {
tag: 'Version: {version} - {date}',
dateFormat: 'h:MM:ss TT', // change timezone: `UTC:h:MM:ss` or `GMT:h:MM:ss`
multiLineCommentType: false, // use `/** */` instead of `//` as comment block
},
InjectByTag: {
fileRegex: /\.+/,
// regexp to find [AIV] tag inside html, if you tag contains unallowed characters you can adjust the regex
// but also you can change [AIV] tag to anything you want
AIVTagRegexp: /(\[AIV])(([a-zA-Z{} ,:;!()_@\-"'\\\/])+)(\[\/AIV])/g,
dateFormat: 'h:MM:ss TT'
}
},
LOGS_TEXT: {
AIS_START: 'DEMO AIV started'
}
})
]
}