-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.iife.js
38 lines (37 loc) · 1.09 KB
/
webpack.config.iife.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path');
const webpack = require('webpack');
const npmPackage = require('./package.json');
const banner = `${npmPackage.name} ${
npmPackage.version
} \nCopyright 2018 Statful \nhttps://www.statful.com`;
module.exports = () => {
return {
entry: {
'statful-browser-plugin': './src/statful-browser-plugin.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].min.js'
},
plugins: [
new webpack.BannerPlugin(banner),
new webpack.DefinePlugin({
PACKAGE_NAME: JSON.stringify(process.env.npm_package_name),
PACKAGE_VERSION: JSON.stringify(process.env.npm_package_version)
})
],
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
}
]
}
]
}
};
};