forked from nearbeach/NearBeach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
98 lines (96 loc) · 4.21 KB
/
webpack.common.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
const path = require('path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader')
const MiniCssExtractplugin = require('mini-css-extract-plugin');
const CompressionPlugin = require('compression-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
module: {
rules: [{
test: /\.s[ac]ss$/i,
use: [{
loader: 'style-loader', // inject CSS to page
}, {
loader: 'css-loader', // translates CSS into CommonJS modules
}, {
loader: 'postcss-loader', // Run post css actions
options: {
postcssOptions: {
plugins: () => { // post css plugins, can be exported to postcss.config.js
return [
require('precss'),
require('autoprefixer')
];
}
}
}
}, {
loader: 'sass-loader' // compiles Sass to CSS
}]
}, {
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.(?:png|jpe?g|gif)$/i,
use: [
{
loader: 'file-loader',
},
],
}, {
test: /\.css$/,
use: [
'style-loader',
'css-loader',
]
}
]
},
plugins: [
new VueLoaderPlugin(),
new MiniCssExtractplugin(),
new CompressionPlugin({
exclude: [
"tinymce",
]
}),
new CopyPlugin({
patterns: [
{ from: './src/resources/NearBeach.png', to: '' },
{ from: './src/resources/NearBeach_Small.png', to: '' },
{ from: './src/resources/images/', to: './images' },
//TinyMce Files
{ from: './node_modules/tinymce/', to: './tinymce/' },
// { from: './node_modules/tinymce/tinymce.min.js', to: './tinymce/tinymce.min.js' },
// { from: './node_modules/tinymce/skins/ui/oxide/skin.min.css', to: './tinymce/skins/ui/oxide/skin.min.css' },
// { from: './node_modules/tinymce/skins/ui/oxide-dark/skin.min.css', to: './tinymce/skins/ui/oxide-dark/skin.min.css' },
// { from: './node_modules/tinymce/skins/content/default/content.min.css', to: './tinymce/skins/content/default/content.min.css' },
// { from: './node_modules/tinymce/skins/content/dark/content.min.css', to: './tinymce/skins/content/dark/content.min.css' },
// { from: './node_modules/tinymce/skins/ui/oxide/content.min.css', to: './tinymce/skins/ui/oxide/content.min.css' },
// { from: './node_modules/tinymce/skins/ui/oxide-dark/content.min.css', to: './tinymce/skins/ui/oxide-dark/content.min.css' },
// { from: './node_modules/tinymce/themes/silver/theme.min.js', to: './tinymce/themes/silver/theme.min.js' },
// { from: './node_modules/tinymce/icons/default/icons.min.js', to: './tinymce/icons/default/icons.min.js' },
// { from: './node_modules/tinymce/plugins/lists/', to: './tinymce/plugins/lists/' },
// { from: './node_modules/tinymce/plugins/paste/', to: './tinymce/plugins/paste/' },
// { from: './node_modules/tinymce/plugins/table/', to: './tinymce/plugins/table/' },
],
}),
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: true,
__VUE_PROD_DEVTOOLS__: false,
}),
// new HtmlWebpackPlugin({
// title: 'Production',
// }),
],
entry: {
'NearBeach': './src/js/app.js',
'login': './src/js/login.js',
'loader': './src/js/loader.js',
},
output: {
path: path.resolve(__dirname, 'NearBeach/static/NearBeach'),
filename: '[name].min.js'
},
};