This repository has been archived by the owner on Apr 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
80 lines (76 loc) · 2.45 KB
/
webpack.config.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* eslint-disable */
const CopyPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
const tsImportPluginFactory = require('ts-import-plugin')
module.exports = {
entry: {
index: './src/index.ts',
convert: './src/convert.ts',
},
output: {
filename: '[name].js',
path: __dirname + '/dist',
chunkFilename: '[id].[chunkhash].js'
},
// externals: ["fs"],
resolve: {
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".ts", ".tsx", ".js"],
modules: ["node_modules", "bower_components"],
},
module: {
rules: [{
test: /\.(tsx|ts)$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
compilerOptions: {
module: 'es2015'
}
},
exclude: [/node_modules/, /bower_components/],
},
{
test: /\.scss$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{ loader: "sass-loader" },
]
},
{
test: /\.css$/,
use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
]
},
]
},
plugins: [
new HtmlWebpackPlugin({
hash: true,
filename: './index.html',
template: './src/index.html',
chunks: ['index',],
}),
new HtmlWebpackPlugin({
hash: true,
filename: './convert.html',
template: './src/convert.html',
chunks: ['convert',],
}),
new webpack.ProvidePlugin({
$: 'jquery',
}),
new CopyPlugin([
{ from: './data', to: './data', }, // Copy our data files
// We have to copy the Palladio files, so that they can be accessed from <script> tags
{ from: './bower_components/palladio', to: './assets/palladio', },
{ from: './bower_components/palladio-map-component', to: './assets/palladio-map-component', },
{ from: './bower_components/palladio-timespan-component', to: './assets/palladio-timespan-component', },
]),
]
};