1 | const path = require('path');
|
2 | const webpack = require('webpack');
|
3 | const CleanWebpackPlugin = require('clean-webpack-plugin');
|
4 |
|
5 |
|
6 |
|
7 | let webpackConfig = {
|
8 | entry: {
|
9 | index: './src/index.js',
|
10 | },
|
11 | output: {
|
12 | path: path.resolve(__dirname, `./build`),
|
13 | filename: '[name].js',
|
14 | library: 'ISO6391',
|
15 | libraryTarget: 'umd'
|
16 | },
|
17 | devtool: 'cheap-source-map',
|
18 | module: {
|
19 | rules: [
|
20 | {
|
21 | test: /\.js$/,
|
22 | exclude: /node_modules/,
|
23 | use: {
|
24 | loader: 'babel-loader',
|
25 | options: {
|
26 | cacheDirectory: require('os').tmpdir(),
|
27 | presets: ['es2015', 'stage-0'],
|
28 | plugins: ['add-module-exports', 'transform-runtime'],
|
29 | },
|
30 | },
|
31 | },
|
32 | ],
|
33 | },
|
34 | plugins: [
|
35 | new webpack.NamedModulesPlugin(),
|
36 | new CleanWebpackPlugin(['./build']),
|
37 |
|
38 | ],
|
39 | };
|
40 |
|
41 | module.exports = webpackConfig;
|