-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (54 loc) · 1.65 KB
/
webpack.config.js
File metadata and controls
56 lines (54 loc) · 1.65 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var path = require("path");
var webpack = require('webpack');
var ManifestPlugin = require('webpack-manifest-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
context: __dirname,
entry: {
metroflow: "./src/js/metroflow.js",
editor: ["./src/js/editor/editor.js"],
viewer: ["./src/js/viewer/viewer.js"],
example_basic: ["./examples/basic/basic.js"],
css: ["./src/css/editor.css", "./src/css/viewer.css"],
},
output: {
library: "MetroFlow",
libraryTarget: "umd",
path: path.join(__dirname, "/dist/"),
filename: "[name].js"
},
module: {
loaders: [
// babel loader, testing for files that have a .js extension
// (except for files in our node_modules folder!).
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ['es2015'],
compact: false // because I want readable output
}
}
],
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})
}
],
},
externals: {
paper: "paper"
},
plugins: [
new ManifestPlugin(),
new ExtractTextPlugin("metroflow-editor.css"),
new ExtractTextPlugin("metroflow-viewer.css"),
new WebpackCleanupPlugin(),
],
};