From 8e9a6c7b4afdff23cb1cbdad842fc6a25e22a011 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Sun, 22 Jul 2018 19:31:28 +0300 Subject: [PATCH] Compile 2 versions of files (es5 and bundled) --- .gitignore | 3 ++- webpack.config.js | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1aae30a..2a516d1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/ .nyc_output coverage dist -compiled.js +bundled.js +es5.js diff --git a/webpack.config.js b/webpack.config.js index a559df6..12b8a9a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,10 @@ const path = require('path'); module.exports = { mode: 'production', // "production" | "development" | "none" // Chosen mode tells webpack to use its built-in optimizations accordingly. - entry: ['babel-polyfill', './src/bowser.js'], // string | object | array + entry: { + bundled: ['babel-polyfill', './src/bowser.js'], + es5: './src/bowser.js', + }, // string | object | array // defaults to ./src // Here the application starts executing // and webpack starts bundling @@ -12,7 +15,7 @@ module.exports = { path: path.resolve(__dirname, './'), // string // the target directory for all output files // must be an absolute path (use the Node.js path module) - filename: 'compiled.js', // string + filename: '[name].js', // string // the filename template for entry chunks library: 'bowser', libraryTarget: 'umd', // universal module definition