1.0.5 • Published 7 years ago

webpack-proxy-plugin v1.0.5

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

# webpack-proxy-plugin


Introduction

The local proxy server for webpack and node.js, which can match the online files to the local. For better develop.

Installation

$ npm install webpack-proxy-plugin --save-dev

Usage

Just add the plugin to your webpack config as follows:

// webpack.config.js
const WebpackProxyPlugin = require('webpack-proxy-plugin');
const proxyRules = require('./proxy-rules');

const webpackConfig = {
	entry: {
		// code
	},
	output: {
		// code
	},
	plugins: [
		new WebpackProxyPlugin(proxyRules)
	]
}
// proxy-rules.js
module.exports = {
	'project_name': {
	    // The file after compile which can `console.log`. In most time,
	    // it equals the output path.
	    develop:`/dist/develop/`,
	    // The file after compile which has been compress and drop console.
	    // And the others are same with `develop` options.
	    production: `/dist/production/`,
	    // True will read the file where in develop path, instead
	    // will read file through production path.
	    debug: true
	}
}

License

MIT

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago