Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
52 lines (42 loc) · 1.44 KB
/
Copy pathwebpack.config.js
File metadata and controls
52 lines (42 loc) · 1.44 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
'use strict';
const webpack = require('webpack');
const path = require('path');
const buildPath = path.join(__dirname, './dist');
var PACKAGE = require('./package.json');
var version = PACKAGE.version;
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
let entry = './sample/sample-site.js';
let plugins = [
new ExtractTextPlugin('[name].[hash].css'),
new HtmlWebpackPlugin({
inject: true,
filename: 'index.html',
template: './sample/template.html',
title: "Sample Radar",
version: version
})
];
module.exports = {
entry: entry,
output: {
path: buildPath,
publicPath: '/',
filename: '[name].[hash].js'
},
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader'},
{ test: /\.scss$/, exclude: /node_modules/, loader: ExtractTextPlugin.extract( {fallback:'style-loader', use: ['css-loader', 'sass-loader'] })},
{ test: /\.(png|jpg|ico)$/, exclude: /node_modules/, loader: 'file-loader?name=images/[name].[ext]&context=./src/images' },
{ test: /\.md$/, loader:'markdown-loader'}
]
},
plugins: plugins,
devtool: 'inline-source-map',
devServer: {
contentBase: buildPath,
host: '0.0.0.0',
port: 8080
}
};