-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrazzle.config.js
78 lines (73 loc) · 3.02 KB
/
razzle.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
"use strict"
// const FaviconsWebpackPlugin = require("favicons-webpack-plugin")
// https://razzlejs.org/docs/customization
// https://github.com/jaredpalmer/razzle/blob/canary/examples/with-heroku/razzle.config.js
module.exports = {
options: {
// cssPrefix: 'static/css',
// jsPrefix: 'static/js',
// mediaPrefix: 'static/media',
// browserslist: undefined, // or what your apps package.json says
forceRuntimeEnvVars: ["HOST", "PORT"],
},
// modify: require("razzle-heroku"),
experimental: {
newBabel: true,
newExternals: true,
newSplitChunks: true,
newContentHash: true,
newMainFields: true,
reactRefresh: true,
},
modifyWebpackConfig(opts) {
const config = opts.webpackConfig
// console.log(config)
// // if (opts.env.target === 'web') {
// return {
// ...config,
// plugins: [
// ...config.plugins,
// new FaviconsWebpackPlugin({
// logo: "./src/assets/icon.svg",
// // Enable caching and optionally specify the path to store cached data
// // Note: disabling caching may increase build times considerably
// cache: true,
// // Override the publicPath option usually read from webpack configuration
// publicPath: process.env.PUBLIC_PATH, // '/static',
// // The directory to output the assets relative to the webpack output dir.
// // Relative string paths are allowed here ie '../public/static'. If this
// // option is not set, `prefix` is used.
// // outputPath: "/public/static",
// // Prefix path for generated assets
// prefix: "assets/",
// // Inject html links/metadata (requires html-webpack-plugin).
// // This option accepts arguments of different types:
// // * boolean
// // `false`: disables injection
// // `true`: enables injection if that is not disabled in html-webpack-plugin
// // * function
// // any predicate that takes an instance of html-webpack-plugin and returns either
// // `true` or `false` to control the injection of html metadata for the html files
// // generated by this instance.
// inject: false,
// // Favicons configuration options (see below)
// // mode: "webapp", // optional can be 'webapp', 'light' or 'auto' - 'auto' by default
// // devMode: "webapp", // optional can be 'webapp' or 'light' - 'light' by default
// // favicons: {
// // appName: "classtimes",
// // appDescription: "Follow your school classes",
// // developerName: "classtimes",
// // // developerURL: null, // prevent retrieving from the nearest package.json
// // background: "#3D2D6B",
// // theme_color: "#3D2D6B",
// // icons: {
// // coast: false,
// // yandex: false,
// // },
// // },
// }),
// ],
// }
return config
},
}