webpack-eliminate-loader
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

webpack-eliminate-loader

speed up build

npm GitHub

Limits

only speed-up webpack in development mode build up.

Useage

see more examples

npm install webpack-eliminate-loader --save-dev

In webpack, put after at the bottom.

// ... other loaders
{
  loader: 'webpack-eliminate-loader',
  options: {
    exclude: ['src/pages/Home'],
    preset: ['react-route'],
  },
},

In webpack-chain, put after at the bottom.

// ... other loaders
const tsUse = config.module.rules.get('ts');
tsUse
  .use('webpack-eliminate-loader')
  .loader('webpack-eliminate-loader')
  .options({
    presets: ['umi-route', 'umi-rematch'],
    include: ['src/pages/page-one'],
  })
  .after('ts-loader');

Options

Options Usage Default
presets the way of how this loader work. Currently, only support umi-route, react-route, umi-rematch(need works with *-route)
include glob-pattern-like string, only build-up pages-in-include, we will have some default include pages []
exclude glob-pattern-like string, will not build-up pages-in-exclude []

NOTE:

In future, it may support custom-preset. For now, if you want use offical presets, you need keep same project-pages-structure like examples

  • react-route - examples/basic-react
  • umi-route and umi-rematch - examples/umi-react

Package Sidebar

Install

npm i webpack-eliminate-loader

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

28 kB

Total Files

41

Last publish

Collaborators

  • qidanta