Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMRSJS-22: Add version number to bundled OWA file name #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/templates/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
const WebpackOnBuildPlugin = require('on-build-webpack');
<% if(includeAngular === true) { %> const ngAnnotatePlugin = require('ng-annotate-webpack-plugin');<% } %>

require.extensions['.webapp'] = function (module, filename) {
module.exports = fs.readFileSync(filename, 'utf8');
};
const manifest = require('./app/manifest.webapp');

const nodeModulesDir = path.resolve(__dirname, '../node_modules');

const THIS_APP_ID = '<%= appId %>';
const THIS_APP_VERSION = JSON.parse(manifest).version;

var plugins = [];
const nodeModules = {};
Expand Down Expand Up @@ -98,7 +104,8 @@ if (env === 'production') {
plugins.push(new WebpackOnBuildPlugin(function(stats){
//create zip file
var archiver = require('archiver');
var output = fs.createWriteStream(THIS_APP_ID+'.zip');
var output = THIS_APP_VERSION ? fs.createWriteStream(`${THIS_APP_ID}-${THIS_APP_VERSION}.zip`)
: fs.createWriteStream(`${THIS_APP_ID}.zip`);
var archive = archiver('zip');

output.on('close', function () {
Expand Down