Skip to content

建议升级到 icejs。基于 webpack 的高可配置开发构建工具。

License

Notifications You must be signed in to change notification settings

ice-lab/ice-scripts

Repository files navigation

English | 简体中文

ice-scripts

NPM version Build Status NPM downloads

🐒Configurable build tool for React project based on webpack. Find detailed instructions in its documentation

Features

ice-scripts have everything you need to build a React app:

  • Fully configurable via ice.config.js, allow your project to have it's configuration
  • The plugin system provides rich features and allow the community to build reusable solutions
  • Out of the box support for ES6+, TypeScripts, Less, Sass, CSS Modules
  • Easy to modify built-in webpack configuration by webpack-chain
  • Delightful JavaScript testing based on Jest

Getting Started

Recommend to create a React app via iceworks

# Install deps
$ npm install iceworks -g

# create an empty folder
$ mkdir iceapp && cd iceapp

# create react project
$ iceworks init

# install dependencies
$ npm install

Once the initialization is done, inside the created project, you can run some built-in commands:

$ npm start

Runs the app in development mode.

It will open http://localhost:4444 for preview. The page will be automatically reloaded if you make changes to the code.

$ npm run build

Builds the app for prodution.

Configuration

Out of the box, ice-scripts won't require you to use a configuration file. If you need to customize your project config, you can create a ice.config.js file in the root folder and ice-scripts will automatically use it.

ice.config.js

const path = require('path');

module.exports = {
  // basic options. see https://ice.work/docs/cli/config/config for more infomation
  entry: 'src/index.js',
  publicPath: './',
  alias: {
    '@components': path.resolve(__dirname, 'src/components/')
  },
  // ...

  // see https://ice.work/docs/cli/plugin-list/fusion for more infomation
  plugins: [
    ['ice-plugins-fusion', { themePackage: '@icedesign/theme' }],
  ],

  // modify webpack configuration via webpack-chain
  chainWebpack: (config) => {
    config.devServer.hot(true);
  }
}

Contributors

Feel free to report any questions as an issue, we'd love to have your helping hand on ice-scripts.

If you're interested in ice-scripts, see CONTRIBUTING.md for more information to learn how to get started.

License

MIT