Ship ESM variant; Ship AMD variant using webpack

This commit is contained in:
Alex Dima 2018-03-08 16:44:27 +01:00
parent 6a61202ff4
commit e2b014d8d7
10 changed files with 6531 additions and 1592 deletions

29
scripts/webpack.js Normal file
View file

@ -0,0 +1,29 @@
const path = require('path');
const webpack = require('webpack');
const REPO_ROOT = path.resolve(__dirname, '..');
exports.createWebpackConfig = function (isDev) {
let targetFolder = isDev ? './release/dev' : './release/min';
let mode = isDev ? 'development' : 'production';
return {
entry: {
"monaco.contribution": './release/esm/monaco.contribution',
"jsonMode": './release/esm/jsonMode',
"jsonWorker": './release/esm/jsonWorker'
},
output: {
filename: '[name].js',
path: path.resolve(REPO_ROOT, targetFolder),
libraryTarget: "amd"
},
mode: mode,
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
})
],
};
}