-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.conf.js
77 lines (70 loc) · 1.68 KB
/
webpack.conf.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
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const path = require('path')
const webpack = require('webpack')
const fs = require('fs')
const scss = {
test: /\.sass$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{ loader: "css-loader", options: {url: false} },
{
loader: 'sass-loader',
options: { indentedSyntax: true }
}
]
})
}
const css = {
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [{ loader: "css-loader", options: {url: false} }]
})
}
const coffee = {
test: /\.coffee$/, loader: 'coffee-loader'
}
const namespace_application = {
mode: 'production',
target: 'electron-renderer',
devtool: 'none',
entry: {
'renderer.js' : path.resolve(__dirname, 'src/application.coffee')
},
output: {
path : path.resolve(__dirname),
filename: '[name]'
},
resolve: {
extensions: ['.coffee','.js','.json'],
modules: ['node_modules/'],
alias: {
components : path.resolve(__dirname, 'src/components/'),
common : path.resolve(__dirname, 'src/common/'),
views : path.resolve(__dirname, 'src/views/'),
lib : path.resolve(__dirname, 'src/lib/'),
}
},
node: { __dirname: false },
module : { rules: [coffee] }
}
const namespace_styles = {
target: 'web',
entry: {
'style.css' : path.resolve(__dirname, 'sass/style.sass')
},
output: {
path : path.resolve(__dirname),
filename: '[name]'
},
node: { __dirname: false },
module : { rules: [scss,css] },
plugins: [
new ExtractTextPlugin("style.css"),
]
}
module.exports = [
namespace_application,
namespace_styles
]