build-scripts-config

raw JSON →
3.0.3 verified Sat Apr 25 auth: no javascript

Basic configs for build-scripts and its plugins. Current stable version 3.6.2. Part of Alibaba's ice framework ecosystem. Provides shared configuration presets for build-scripts, including webpack and rspack support. Differentiates by offering AST-based export analysis and support for multiple bundlers.

error Cannot find module 'build-scripts-config'
cause Package not installed
fix
npm install build-scripts-config
error TypeError: webpack is not a constructor
cause Missing webpack peer dependency
fix
npm install webpack@4.41.1
error SyntaxError: Cannot use import statement outside a module
cause Using ESM imports without 'type: module' in package.json
fix
Add type:module to package.json or rename file to .mjs
gotcha Peer dependency webpack@^4.41.1 must be installed manually.
fix Install webpack@4.41.1 or compatible version: npm install webpack@4.41.1
breaking ESM-only in v3: CommonJS require() will not work.
fix Use ES module imports (import syntax) and ensure package.json has type:module or use .mjs extension.
deprecated createConfig is deprecated in favor of defineConfig from @ice/app.
fix Use defineConfig from @ice/app instead of createConfig from build-scripts-config.
npm install build-scripts-config
yarn add build-scripts-config
pnpm add build-scripts-config

Shows using build-scripts-config to configure webpack in an ice app.

import { defineConfig } from '@ice/app';
import config from 'build-scripts-config';
import webpack from 'webpack';

export default defineConfig(() => ({
  webpack: config.webpack,
  plugins: [{
    name: 'example-plugin',
    apply: (api) => {
      api.chainWebpack((chain) => {
        chain.resolve.alias.set('@', __dirname);
      });
    },
  }],
}));