Home > @lynx-js/rspeedy > Tools > rspack
Tools.rspack property
The Tools.rspack controls the options of Rspack.
Signature:
rspack?: ToolsConfig['rspack'] | undefined;
Example 1
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
tools: {
rspack: {
resolve: {
fullySpecified: true,
},
},
},
})
See Rspack - Configuration for details.
Example 2
- Use function with
env
utils
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
tools: {
rspack(config, { env }) {
if (env === 'development') {
config.devtool = 'cheap-source-map'
}
return config
},
},
})
See Rsbuild - tools.rspack for details.
Example 3
- Use function with
mergeConfig
utils
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
tools: {
rspack(config, { mergeConfig }) {
return mergeConfig(config, {
resolve: {
fullySpecified: true,
},
})
},
},
})
See Rsbuild - tools.rspack for details.
Example 4
- Use function with
appendPlugins
utils
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
tools: {
rspack(config, { appendPlugins, rspack }) {
appendPlugins(new rspack.BannerPlugin({ banner: 'Hello, World!' }))
return config
},
},
})
See Rsbuild - tools.rspack for details.