-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (29 loc) · 1.07 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
module.exports = (...args) => {
// Here using the example for react
// const config = require('@leanup/stack-react/webpack.config')(...args);
const config = require('@leanup/stack-solid/webpack.config')(...args);
const UnoCSS = require('@unocss/webpack').default;
config.plugins.unshift(UnoCSS());
config.module.rules.push({
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
},
},
],
});
if (args[0].WEBPACK_BUILD) {
const path = require('path');
const WebpackPwaManifest = require('webpack-pwa-manifest');
const pwaManifestConfigPath = path.resolve(process.cwd(), 'pwa-manifest.config.js');
const { GenerateSW } = require('workbox-webpack-plugin');
const workboxConfigPath = path.resolve(process.cwd(), 'workbox-config.js');
config.plugins.push(new WebpackPwaManifest(require(pwaManifestConfigPath)));
config.plugins.push(new GenerateSW(require(workboxConfigPath)));
}
return config;
};