This package has been deprecated

Author message:

Better inject the thread-loader manually into your webpack chain!

vue-thread-loader

0.1.0 • Public • Published

Vue Thread loader

Improve your build speed

Installation

Install it using npm or yarn:

yarn add vue-thread-loader --dev
npm i vue-thread-loader --save-dev

Usage

vue-thread-loader exposes a single function which receives a configuration object. Pass this to your vue.config.js configureWebpack option.

vue.config.js
const vueThreadLoader = require('vue-thread-loader');
 
module.exports = {
    configureWebpack: vueThreadLoader({
        silent: Boolean // Default: true -> Supress log
        filter: Function // Default: null -> A function which reveices the rule / current env and returns a falsy value if this rule should be skipped
        mode: String // Default: 'any' -> Gets be compared to NODE_ENV and decides where the thread-loader should be injected. Use 'all' to allow all.
    })
}

Or use it in-line:

const vueThreadLoader = require('vue-thread-loader');
 
module.exports = {
    configureWebpack(config) {
        // Your other stuff
        vueThreadLoader()(config);
    }
}

Examples

No debug log of vueThreadLoader. thread-loader gets injected into every chain and on any NODE_ENV.

module.exports = {
    configureWebpack: vueThreadLoader()
}

Print debug log of vueThreadLoader. thread-loader gets injected into every chain but only on production mode.

module.exports = {
    configureWebpack: vueThreadLoader({
        mode: 'production', 
        silent: false
    })
}

No debug log of vueThreadLoader. thread-loader gets only injected into the vue chain and production mode.

module.exports = {
    configureWebpack: vueThreadLoader({
        mode: 'production', 
        filter(rule, env) {
            return rule.test.toString().includes('vue')
        }
    })
}

Package Sidebar

Install

npm i vue-thread-loader

Weekly Downloads

11

Version

0.1.0

License

MIT

Unpacked Size

6.09 kB

Total Files

5

Last publish

Collaborators

  • simonwep