-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (31 loc) · 1011 Bytes
/
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
var fs = require("fs");
var path = require('path');
var webpack = require("webpack");
var CopyWebpackPlugin = require('copy-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
dashboard: './app/javascripts/dashboard.jsx',
},
output: {
path: "./docs",
filename: '[name].js'
},
module: {
loaders: [
{ test: /\.(js|jsx|es6)$/, exclude: /node_modules/, loader: "babel-loader"},
{ test: /\.s?(c|a)?ss$/i, loader: ExtractTextPlugin.extract(["css", "sass"])},
{ test: /\.json$/i, loader: "json-loader"},
{ test: /\.jpg$/, loader: "file-loader?name=[path][name].[ext]" }
]
},
plugins: [
new CopyWebpackPlugin([
{ from: './app/index.html', to: "index.html" },
{ from: './app/images', to: "images" }
]),
new ExtractTextPlugin("[name].css"),
],
resolve: { fallback: path.join(__dirname, "node_modules") },
resolveLoader: { fallback: path.join(__dirname, "node_modules") }
};