This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.base.js
45 lines (44 loc) · 1.81 KB
/
webpack.config.base.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
import path from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
export default {
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/',
},
target: 'web',
plugins: [
new CopyWebpackPlugin(
[ {from:'bower_components/web*/*.html'},
{from:'bower_components/web*/*.js'},
{from:'bower_components/neon-*/**/*.html'},
{from:'bower_components/iron-*/*.html'},
{from:'bower_components/paper-*/*.html'},
{from:'bower_components/font-*/*.html'},
{from:'bower_components/polymer/*.html'}
]
),
new HtmlWebpackPlugin({
template: 'src/index.html',
minify: {
removeComments: true,
collapseWhitespace: true
},
inject: true
})
],
module: {
loaders: [
{ test: /\.json$/, loader: 'json' },
{ test: /\.js$/, include: path.join(__dirname, 'src'), loaders: ['babel'] },
{ test: /\.eot(\?v=\d+.\d+.\d+)?$/, loader: 'file' },
{ test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
{ test: /\.ttf(\?v=\d+.\d+.\d+)?$/, loader: 'file-loader?limit=10000&mimetype=application/octet-stream' },
{ test: /\.svg(\?v=\d+.\d+.\d+)?$/, loader: 'file-loader?limit=10000&mimetype=image/svg+xml' },
{ test: /\.(jpe?g|png|gif)$/i, loader: 'file-loader?name=[name].[ext]' },
{ test: /\.ico$/, loader: 'file-loader?name=[name].[ext]' },
{ test: /(\.css|\.scss)$/, loaders: ["style-loader", "css-loader", "sass-loader"] }
]
},
};