Doodle3D-Slicer/simpleExample/webpack.config.js

59 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-07-20 12:12:25 +02:00
const path = require('path');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const HTMLWebpackPlugin = require('html-webpack-plugin');
const babelLoader = {
loader: 'babel-loader',
options: {
presets: [
2017-07-24 17:47:03 +02:00
['latest', {
'modules': false,
'loose': true
2017-07-20 12:12:25 +02:00
}]
],
2017-07-20 16:14:01 +02:00
plugins: [require('babel-plugin-transform-object-rest-spread')],
babelrc: false
2017-07-20 12:12:25 +02:00
}
}
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
alias: {
2017-07-24 17:47:03 +02:00
'doodle3d-slicer': path.resolve(__dirname, '../src/index.js'),
'clipper-lib': '@doodle3d/clipper-lib',
'clipper-js': '@doodle3d/clipper-js'
2017-07-20 12:12:25 +02:00
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: babelLoader
},
{
test: /\.yml$/,
2017-07-20 16:58:42 +02:00
use: 'yml-loader'
2017-07-20 12:12:25 +02:00
},
{
test: /\.worker\.js$/,
use: ['worker-loader', babelLoader]
}
]
},
plugins: [
new HTMLWebpackPlugin({
title: 'Doodle3D Slicer - Simple example'
}),
],
devtool: "source-map",
devServer: {
contentBase: 'dist'
}
};