From 434abbc78aa443ddd9816c444062b427c41b10ce Mon Sep 17 00:00:00 2001 From: Benjamin Fleming Date: Mon, 11 Dec 2017 13:30:32 +1100 Subject: [PATCH] Now using UMD --- build/webpack.build.js | 8 ++++++++ src/main.js | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/webpack.build.js b/build/webpack.build.js index 8b34168..43b7145 100644 --- a/build/webpack.build.js +++ b/build/webpack.build.js @@ -1,6 +1,7 @@ const webpack = require('webpack') const path = require('path') const config = require('./webpack') +const package = require('../package.json') module.exports = Object.assign(config, { devtool: 'source-map', @@ -8,6 +9,8 @@ module.exports = Object.assign(config, { output: { path: path.resolve(__dirname, '../dist/'), filename: 'warp.js', + library: 'Warp', + libraryTarget: 'umd', }, plugins: [ new webpack.optimize.UglifyJsPlugin({ @@ -15,5 +18,10 @@ module.exports = Object.assign(config, { output: { comments: false }, sourceMap: true, }), + new webpack.BannerPlugin({ + banner: `/*! Warp.js v${package.version} (${package.license}) */`, + raw: true, + entryOnly: true, + }), ], }) diff --git a/src/main.js b/src/main.js index 78c4cad..d7b8f84 100644 --- a/src/main.js +++ b/src/main.js @@ -1,8 +1,2 @@ import Warp from './Warp' - -if(typeof window !== 'undefined') -{ - window.Warp = Warp -} - export default Warp