forked from steemit/condenser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.config.js
148 lines (144 loc) · 4.63 KB
/
base.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const writeStats = require('./utils/write-stats');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const Webpack_isomorphic_tools_plugin = require('webpack-isomorphic-tools/plugin');
const webpack_isomorphic_tools_plugin =
new Webpack_isomorphic_tools_plugin(require('./webpack-isotools-config'))
.development();
const css_loaders = [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
{
loader: 'autoprefixer-loader'
}
]
const scss_loaders = [
{
loader: 'css-loader',
},
{
loader: 'autoprefixer-loader'
},
{
loader: 'sass-loader'
}
]
module.exports = {
entry: {
app: ['babel-polyfill', './src/app/Main.js'],
vendor: [
'react',
'react-dom',
'react-router',
'@steemit/steem-js',
'slate',
'slate-drop-or-paste-images',
'slate-insert-block-on-enter',
'slate-trailing-block',
'bytebuffer',
'immutable',
'autolinker',
'pako',
'remarkable',
'picturefill'
]
},
output: {
path: path.resolve(__dirname, '../dist'),
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].js',
publicPath: '/assets/'
},
module: {
rules: [
{test: /\.(jpe?g|png|gif)/, use: 'url-loader?limit=4096'},
{test: /\.json$/, use: 'json-loader'},
{test: /\.js$|\.jsx$/, exclude: [/node_modules/, /\*\/app\/assets\/static\/\*\.js/], use: 'babel-loader'},
{test: /\.svg$/, use: 'svg-inline-loader'},
{
test: require.resolve("blueimp-file-upload"),
use: "imports?define=>false"
},
{
test: /\.css$/,
use: css_loaders
},
{
test: /\.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: scss_loaders
})
},
{
test: /\.md/,
use: 'raw-loader'
},
{
loader: 'file-loader?name=[name].[hash].[ext]&limit=1',
test: /\.(eot|ttf|woff|woff2)(\?.+)?$/,
},
]
},
plugins: [
function () {
this.plugin('done', writeStats);
},
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.CommonsChunkPlugin({
names: 'vendor',
minChunks: Infinity
}),
webpack_isomorphic_tools_plugin,
new ExtractTextPlugin('[name]-[chunkhash].css'),
new CopyWebpackPlugin(
[
{
from: path.resolve(__dirname, '../src/app/assets/js/jquery-3.6.0.min.js'),
to: path.resolve(__dirname, '../dist/js/jquery-3.6.0.min.js')
},
{
from: path.resolve(__dirname, '../src/app/assets/js/jquery-3.6.0.min.map'),
to: path.resolve(__dirname, '../dist/js/jquery-3.6.0.min.map')
},
{
from: path.resolve(__dirname, '../src/app/assets/js/tron-ads-sdk-1.0.49.js'),
to: path.resolve(__dirname, '../dist/js/tron-ads-sdk-1.0.49.js')
},
{
from: path.resolve(__dirname, '../src/app/assets/plugins'),
to: path.resolve(__dirname, '../dist/plugins/')
},
], {
ignore: [
'../src/app/assets/plugins/editor.md/examples',
'../src/app/assets/plugins/editor.md/scss',
'../src/app/assets/plugins/editor.md/src',
'../src/app/assets/plugins/editor.md/tests',
],
}
),
],
resolve: {
alias: {
react: path.join(__dirname, '../node_modules', 'react'),
assets: path.join(__dirname, '../src/app/assets'),
// editormd: path.join(__dirname, '../src/app/assets/js/plugins/editor.md'),
// $: path.join(__dirname, '../src/app/assets/js/jquery-3.1.0.slim.js'),
// editormdlib: path.join(__dirname, '../src/app/assets/js/lib'),
},
extensions: ['.js', '.json', '.jsx'],
modules: [
path.resolve(__dirname, '../src'),
'node_modules'
]
},
externals: {
}
};