mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-30 10:20:52 -05:00
Set loose build version on dev server
This commit is contained in:
parent
f471d4e6dd
commit
1fcf29279f
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@ module.exports = (env = {}) => {
|
||||||
const minimize = env.MINIMIZE || false;
|
const minimize = env.MINIMIZE || false;
|
||||||
const edge = env.EDGE || false;
|
const edge = env.EDGE || false;
|
||||||
const maxSize = minimize ? 100 * 1024 : 512 * 1024;
|
const maxSize = minimize ? 100 * 1024 : 512 * 1024;
|
||||||
|
const isDevServer = process.env.WEBPACK_DEV_SERVER;
|
||||||
|
|
||||||
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
const commitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
||||||
const version = !edge ? pkg.version : `${pkg.version}-alpha-${commitHash}`;
|
const version = !edge ? pkg.version : `${pkg.version}-alpha-${commitHash}`;
|
||||||
|
@ -37,7 +38,7 @@ module.exports = (env = {}) => {
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.BannerPlugin(banner),
|
new webpack.BannerPlugin(banner),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
__MATTER_VERSION__: JSON.stringify(version),
|
__MATTER_VERSION__: JSON.stringify(!isDevServer ? version : '*'),
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
externals: {
|
externals: {
|
||||||
|
|
Loading…
Reference in a new issue