0.2.0 • Published 8 years ago

webpack-link v0.2.0

Weekly downloads
812
License
ISC
Repository
github
Last release
8 years ago

webpack-link

Webpack replacement for NPM link

Uses Webpack alias options to resolve a module to a local path for development.

Install

$ npm install webpack-link --save-dev

Usage

By default, adding a config doesn't turn on the linked module. To turn it on for a build you need to pass webpack a --link parameter with a comma separated list of modules to be linked.

eg: webpack --link=localModule

config

var path = require('path'),
    webpackLinkPlugin = require('webpack-link')

module.exports = {
  entry: "src/index.js",
  plugins: [
    new webpackLinkPlugin({
      localModule: path.resolve(__dirname, '../localModule')
    })
  ],
  output: {
    filename: "build.js",
  }
}

Using loaders

var path = require('path'),
    webpackLinkPlugin = require('webpack-link')

module.exports = {
  entry: "src/index.js",
  plugins: [
    new webpackLinkPlugin({
      localModule: [
        path.resolve(__dirname, '../localeModule'),
        {
          entry: path.resolve(__dirname, '../localeModule/src'),
          test: /\.js$/,
          loader: "babel-loader?presets[]=es2015"
        }
      ]
    })
  ],
  output: {
    filename: "build.js",
  }
}
0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago