0.0.0 • Published 7 years ago

node4-module-paths v0.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Synopsis

A lot of node modules are only targeting node v4 and up. But it doesn't play well with webpack since 1) plugins like uglify doesn't support ES6 yet and 2) ES6 browser support isn't great yet.

Usage

const path = require('path')
const node4ModulePaths = require('node4-module-paths')

// Then in some async function
const es6ModulePaths = await node4ModulePaths();

{
  test: /\.js$/,
  include: [
    ...es6ModulePaths,
    path.resolve(__dirname, 'src'),
  ],
  use: 'babel-loader',
}

CLI

npm i -g node4-module-paths
node4-module-paths

Use the command to inspect your project.