-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from vannyle/additional-updates
feat: additional updates
- Loading branch information
Showing
10 changed files
with
3,409 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,59 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
// basePath: '/inbox/playground', | ||
// assetPrefix: '/inbox/playground/', | ||
webpack(config) { | ||
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.(".svg")); | ||
|
||
config.module.rules.push( | ||
// Reapply the existing rule, but only for svg imports not ending in ".inline.svg" | ||
{ | ||
test: /(?<!inline)\.svg$/, | ||
use: [ | ||
{ | ||
loader: "url-loader", | ||
options: { | ||
limit: 512, | ||
publicPath: "/_next/static/svgs", | ||
outputPath: "static/svgs", | ||
fallback: "file-loader", | ||
}, | ||
}, | ||
{ | ||
loader: "svgo-loader", | ||
}, | ||
], | ||
}, | ||
// Convert all other *.svg imports to React components | ||
{ | ||
test: /\.inline.svg$/i, | ||
use: [ | ||
{ | ||
loader: "@svgr/webpack", | ||
options: { | ||
svgo: true, | ||
svgoConfig: { | ||
plugins: [ | ||
{ | ||
name: "preset-default", | ||
params: { | ||
overrides: { | ||
removeViewBox: false, | ||
}, | ||
}, | ||
}, | ||
"prefixIds", | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
); | ||
|
||
// Modify the file loader rule to ignore *.svg, since we have it handled now. | ||
fileLoaderRule.exclude = /\.svg$/i; | ||
|
||
return config; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
Oops, something went wrong.