Movatterモバイル変換


[0]ホーム

URL:


next-remove-imports

NPM DownloadsBuild & DeployRepo Dependents

This is a plugin fornextjs. The default behavior is to remove all.less/.css/.scss/.sass/.styl imports from all packages in node_modules.

WarningCSS Imported by a Dependency#52

Install

npminstall next-remove-imports# oryarnadd next-remove-imports

Usage

// next.config.mjsimportremoveImportsfrom'next-remove-imports'/**@type{function(import("next").NextConfig):import("next").NextConfig}} */const removeImportsFun=removeImports({// test: /node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/,// matchImports: "\\.(less|css|scss|sass|styl)$"});exportdefaultremoveImportsFun({webpack(config, options){return config},});
// next.config.jsconst removeImports=require('next-remove-imports')({options:{},})module.exports=removeImports()
// next.config.jsconst removeImports=require('next-remove-imports')()module.exports=removeImports({webpack(config, options){return config},});
// next.config.jsconst removeImports=require('next-remove-imports')({test:/node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/,matchImports:"\\.(less|css|scss|sass|styl)$"});module.exports=removeImports({webpack(config, options){return config},});
// next.config.jsconst removeImports=require('next-remove-imports')();module.exports=(phase,{ defaultConfig})=>{returnremoveImports({...defaultConfig});};

Options

exporttypePluginOptions={/**   * @default "/node_modules([\s\S]*?)\.(tsx|ts|js|mjs|jsx)$/"   */  test?: RegExp;/**   * @default "\\.(less|css|scss|sass|styl)$"   */  matchImports?:string;}

License

Licensed under the MIT License.


[8]ページ先頭

©2009-2025 Movatter.jp