Skip to content

Commit

Permalink
Now using UMD
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamminf committed Dec 11, 2017
1 parent 6373b69 commit 434abbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions build/webpack.build.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
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',
entry: path.resolve(__dirname, '../src/main.js'),
output: {
path: path.resolve(__dirname, '../dist/'),
filename: 'warp.js',
library: 'Warp',
libraryTarget: 'umd',
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false },
output: { comments: false },
sourceMap: true,
}),
new webpack.BannerPlugin({
banner: `/*! Warp.js v${package.version} (${package.license}) */`,
raw: true,
entryOnly: true,
}),
],
})
6 changes: 0 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
import Warp from './Warp'

if(typeof window !== 'undefined')
{
window.Warp = Warp
}

export default Warp

0 comments on commit 434abbc

Please sign in to comment.