From b8da2a85a6d45f720aa178812a4032f588f366f4 Mon Sep 17 00:00:00 2001 From: Kevin Chappell Date: Thu, 21 Mar 2019 20:45:53 -0700 Subject: [PATCH] fix(module): bundle as UMD to work in browser and import (#181) --- package.json | 3 +-- tools/webpack.config.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 26b7078d..fd2b48d9 100644 --- a/package.json +++ b/package.json @@ -90,8 +90,7 @@ "es6.promise", "es6.object.assign" ], - "loose": true, - "modules": false + "loose": true } ] ], diff --git a/tools/webpack.config.js b/tools/webpack.config.js index 7c53c278..6c40bf9b 100644 --- a/tools/webpack.config.js +++ b/tools/webpack.config.js @@ -56,7 +56,7 @@ const plugins = [ nativeName: lang[locale], } }), - version + version, }), new HtmlWebpackHarddiskPlugin({ outputPath: './demo/' }), new MiniCssExtractPlugin({ @@ -95,13 +95,13 @@ const extractTextLoader = !IS_PRODUCTION const webpackConfig = { mode: IS_PRODUCTION ? 'production' : 'development', - target: 'web', context: outputDir, entry, output: { path: projectRoot, publicPath: '/dist', filename: `[name].min.js`, + libraryTarget: 'umd', }, module: { rules: [