2018-06-15 09:50:17 +02:00
|
|
|
const webpack = require('webpack');
|
2018-06-30 01:05:17 +02:00
|
|
|
const packageJson = require('./package.json');
|
2018-06-15 09:50:17 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: `${__dirname}/src/index.js`,
|
2018-06-30 01:05:17 +02:00
|
|
|
output: {
|
|
|
|
library: 'BoxIconElement',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
filename: 'box-icon-element.js',
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
babelrc: false,
|
|
|
|
presets: [
|
|
|
|
['env', { modules: false, targets: { uglify: true } }],
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
['babel-plugin-transform-builtin-classes', {
|
|
|
|
globals: ['Array', 'Error', 'HTMLElement'],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.css$/,
|
|
|
|
use: [
|
|
|
|
{ loader: 'to-string-loader' },
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
camelCase: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'BUILD.DATA': {
|
|
|
|
VERSION: JSON.stringify(packageJson.version),
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|