-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.prod.server.config.js
More file actions
executable file
·89 lines (85 loc) · 2.14 KB
/
webpack.prod.server.config.js
File metadata and controls
executable file
·89 lines (85 loc) · 2.14 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const path = require('path');
const webpack = require('webpack');
const cssnext = require('postcss-cssnext');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const postcssFocus = require('postcss-focus');
const postcssReporter = require('postcss-reporter');
// const SCSSLoaders = extractSCSS.extract({
// fallback: 'style-loader',
// use: [
// {
// loader: 'css-loader',
// options: {
// modules: true,
// // localIdentName: '[local]',
// importLoaders: true,
// sourceMap: true
// }
// },
// {
// loader: 'postcss-loader',
// options: {
// plugins: () => {
// return [
// postcssFocus(), // Add a :focus to every :hover
// cssnext({ // Allow future CSS features to be used, also auto-prefixes the CSS...
// browsers: ['last 2 versions', 'IE > 10'], // ...based on this browser list
// }),
// postcssReporter({ // Posts messages from plugins to the terminal
// clearMessages: true,
// }),
// ];
// },
// },
// },
// 'sass-loader',
// ],
// });
module.exports = {
entry: "./src/server/index.js",
output: {
filename: "server.js",
// filename: "server.min.js",
publicPath: "/assets/",
path: "build/public"
},
target: 'node',
module: {
rules: [
{
test: /\.js?$/,
exclude: [ /node_modules/ ],
use: [ 'babel-loader' ]
},
{
test: /\.s?css$/,
exclude: [ /node_modules/ ],
use: [ 'null-loader' ]
},
{
test: /\.(jpg)$/,
exclude: [ /node_modules/ ],
use: 'file-loader?name=images/[path][name]-[hash].[ext]&context=src'
},
{
test: /\.json?$/,
use: [ 'json-loader' ]
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV:'"production"',
HOST: '"localhost"',
PORT: '"3030"'
}
}),
// new webpack.optimize.UglifyJsPlugin({
// compressor: {
// screw_ie8: true,
// warnings: false
// }
// })
]
};