mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 12:40:21 +03:00
29 lines
769 B
TypeScript
29 lines
769 B
TypeScript
|
|
export default defineNuxtConfig({
|
||
|
|
compatibilityDate: '2026-07-01',
|
||
|
|
devtools: { enabled: false },
|
||
|
|
builder: 'webpack',
|
||
|
|
nitro: {
|
||
|
|
externals: {
|
||
|
|
inline: ['entities'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
hooks: {
|
||
|
|
'webpack:config'(configs) {
|
||
|
|
for (const config of configs) {
|
||
|
|
const rules = config.module?.rules ?? []
|
||
|
|
for (const rule of rules) {
|
||
|
|
if (rule && typeof rule === 'object' && rule.test instanceof RegExp && rule.test.test('icon.svg')) {
|
||
|
|
rule.exclude = rule.exclude ? [rule.exclude, /\.svg$/i] : /\.svg$/i
|
||
|
|
}
|
||
|
|
}
|
||
|
|
rules.unshift({ test: /\.svg$/i, type: 'asset/resource' })
|
||
|
|
}
|
||
|
|
},
|
||
|
|
},
|
||
|
|
vue: {
|
||
|
|
compilerOptions: {
|
||
|
|
isCustomElement: (tag) => tag === 'gromlab-sprite-viewer',
|
||
|
|
},
|
||
|
|
},
|
||
|
|
})
|