laravel-mix-transpile-node-modules

    2.0.4 • Public • Published

    Laravel Mix Transpile Node Modules

    Software License Latest Version on NPM

    Laravel Mix extension for Babel-transpiling dependencies inside node_modules.

    Installation

    npm install laravel-mix-transpile-node-modules

    Usage

    Require the extension inside your webpack.mix.js and call transpileNodeModules().

    const mix = require('laravel-mix')
    require('laravel-mix-transpile-node-modules')
    
    mix.js('src/main.js', 'dist')
    
    /**
     * Transpile node_modules in production
     */
    if (mix.inProduction()) {
      mix.transpileNodeModules()
    }

    Options

    Transpile all node modules

    This is the default behavior. Same as passing true.

    mix.transpileNodeModules()

    Transpile selected node modules

    Pass an array of npm module names to transpile.

    mix.transpileNodeModules(['swiper', 'dom7'])

    Don't transpile node modules

    Same as not calling the extension at all.

    mix.transpileNodeModules(false)

    Install

    npm i laravel-mix-transpile-node-modules

    DownloadsWeekly Downloads

    796

    Version

    2.0.4

    License

    MIT

    Unpacked Size

    6.73 kB

    Total Files

    5

    Last publish

    Collaborators

    • daun