-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (61 loc) · 1.65 KB
/
webpack.config.js
File metadata and controls
63 lines (61 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
57
58
59
60
61
62
63
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const pkg = require('./package.json');
const config = {
context: path.resolve(__dirname, 'app'),
entry: path.join(__dirname, '/app/index'),
output: {
path: path.join(__dirname, '/dist/'),
library: 'YTC',
libraryTarget: 'umd',
umdNamedDefine: true,
filename: 'js/youtube-chapters.js'
},
devServer: {
contentBase: path.join(__dirname, '/public/')
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel-loader', 'eslint-loader']
},
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=1000000'
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: ['css-loader', 'postcss-loader', 'sass-loader']
})
},
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'raw-loader'
}
]
},
plugins: [
new ExtractTextPlugin('css/youtube-chapters.css'),
new webpack.BannerPlugin({
banner: `/*!\n * ${pkg.name}\n * ${pkg.title}\n * ${pkg.url}\n * @author ${pkg.author}\n * @version ${pkg.version}\n * Copyright ${pkg.copyright}. ${pkg.license} licensed.\n */\n`,
raw: true,
test: /\.js$/,
})
],
watch: false
};
module.exports = config;