-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (44 loc) · 1.51 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const HtmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/main.coffee',
output: {
filename: 'main.js'
},
module: {
rules: [
{ test: /\.js$/ , use: 'babel-loader' },
{ test: /\.vue$/ , use: 'vue-loader' },
{ test: /\.pug$/ , use: 'pug-plain-loader'},
{ test: /\.coffee$/ , use: 'coffee-loader' },
{ test: /\.(png|jpg|gif)$/i, use: 'url-loader' },
{ test: /\.css$/ , use: [MiniCssExtractPlugin.loader, 'css-loader']},
{ test: /\.styl$/ , use: [MiniCssExtractPlugin.loader, 'css-loader','stylus-loader'] },
// Vuetify
{ test: /\.s(c|a)ss$/,
use: [MiniCssExtractPlugin.loader, 'css-loader', { loader: 'sass-loader', options: { implementation: require('sass'), }, },],
},
]
},
plugins: [
new VueLoaderPlugin(),
// Сохраняем CSS отдельно
new MiniCssExtractPlugin({
filename: 'style.css'
}),
// Копируем библиотеки
new CopyPlugin({
patterns: [
{from: "manifest.json"},
{from: "img/favicon.png"},
{from: "lib/xlsx.mini.min.js"},
{from: "lib/vue.js"},
{from: "lib/vuetify.js"},
{from: "lib/vuetify.min.css"},
{from: "fonts", to: "fonts"},
]
})
]
};