This repository was archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
117 lines (109 loc) · 2.32 KB
/
Copy pathwebpack.dev.js
File metadata and controls
117 lines (109 loc) · 2.32 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
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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
module.exports = {
mode: 'development',
//entry point
entry: path.join(__dirname, './frontend/root.js'),
// compiled output js
output: {
filename: 'assets/js/[name].[hash].js',
},
module: {
rules: [
{
test: /\.js?$/,
// only process files in src folder
include: /frontend/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.css$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: '../',
},
},
'css-loader',
],
},
],
},
devServer: {
contentBase: './dist',
hot: true,
},
plugins: [
new HtmlWebpackPlugin({
inject: false,
template: require('html-webpack-template'),
title: 'SwiftSheet',
lang: 'en-US',
appMountId: 'app',
meta: [
{
name: 'viewport',
content: 'width=device-width, initial-scale=1.0',
},
,
{
name: 'author',
content: 'Alek Shnayder',
},
{
name: 'description',
content:
'Upload a CSV to share an online spreadsheet or mock GraphQL or REST API endpoint that auto-deletes after expiration. No user account needed.',
},
],
links: [
'https://fonts.googleapis.com/css?family=Poiret+One&text=SwiftSheet:300',
'https://fonts.googleapis.com/css?family=Quicksand:400,600,700',
'https://fonts.googleapis.com/icon?family=Material+Icons',
{
href: '/assets/css/reset.css',
rel: 'preload',
as: 'style',
},
{
href: './assets/css/reset.css',
rel: 'stylesheet',
},
{
href: './assets/images/favicon/favicon-32x32.png',
rel: 'icon',
sizes: '32x32',
type: 'image/png',
},
{
href: './assets/images/favicon/favicon-16x16.png',
rel: 'icon',
sizes: '16x16',
type: 'image/png',
},
],
}),
new webpack.HotModuleReplacementPlugin(),
new MiniCssExtractPlugin({
filename: 'assets/css/[name].[hash].css',
}),
],
optimization: {
//break out vendor module to separate folder
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
chunks: 'initial',
},
},
},
},
devtool: 'eval-source-map',
};