Skip to content

Commit

Permalink
Update webpack configuration to use new locations and build svg output
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Oct 4, 2018
1 parent 769c6b1 commit a5511ce
Showing 1 changed file with 42 additions and 21 deletions.
63 changes: 42 additions & 21 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,60 @@ const MODULE = function () {
// Create a configuration for a distribution file
//
const CONFIG = function (name) {
return {
name: name,
entry: './mj3-' + name + '.js',
output: {
path: __dirname,
filename: 'mj3-' + name + '.dist.js'
},
module: MODULE(),
plugins: PLUGINS(),
performance: {
hints: false
},
mode: 'production'
};
const dir = __dirname + '/' + name.replace(/-.*/,'');
return {
name: name,
entry: dir + '/mj3-' + name + '.js',
output: {
path: dir,
filename: 'mj3-' + name + '.dist.js'
},
module: MODULE(),
plugins: PLUGINS(),
performance: {
hints: false
},
mode: 'production'
};
}

//
// The four main configurations
//
const mml2html = CONFIG('mml2html');
const tex2html = CONFIG('tex2html');
const mml2htmlsimple = CONFIG('mml2html-simple');
const tex2htmlsimple = CONFIG('tex2html-simple');
const mml2htmlglobal = CONFIG('mml2html-global');
const tex2htmlglobal = CONFIG('tex2html-global');
const mml2htmlbeta = CONFIG('mml2html-beta');
const tex2htmlbeta = CONFIG('tex2html-beta');

const mml2htmlbeta = CONFIG('mml2html-beta');
const tex2htmlbeta = CONFIG('tex2html-beta');
const mml2svgsimple = CONFIG('mml2svg-simple');
const tex2svgsimple = CONFIG('tex2svg-simple');
const mml2svgglobal = CONFIG('mml2svg-global');
const tex2svgglobal = CONFIG('tex2svg-global');
const mml2svgbeta = CONFIG('mml2svg-beta');
const tex2svgbeta = CONFIG('tex2svg-beta');

//
// Compile all configurations
//
module.exports = [mml2html, tex2html,
mml2htmlglobal, tex2htmlglobal,
mml2htmlbeta, tex2htmlbeta];
module.exports = [
mml2htmlsimple,
mml2htmlglobal,
mml2htmlbeta,

tex2htmlsimple,
tex2htmlglobal,
tex2htmlbeta,

mml2svgsimple,
mml2svgglobal,
mml2svgbeta,

tex2svgsimple,
tex2svgglobal,
tex2svgbeta
];

// OR compile one configuration, e.g.,:
// module.exports = tex2html;

0 comments on commit a5511ce

Please sign in to comment.