JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q55221F
  • License ISC

the webpack base config

Package Exports

  • webpack-base-config

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (webpack-base-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

webpack-base-config

the webpack base config of react develop environment
使用webpack、webpack-dev-server快速搭建react开发环境

中文文档

Install

npm install webpack-base-config --save-dev

Usage

in root directory of your project create new js file(e.g: server.js) and write following code:

const { webpackConfig, webpackDevServer } = require('webpack-base-config');

webpackDevServer(webpackConfig(Options));

In order to ensure the Babel compilation, you need to create .babelrc file in your root directory

{
  "presets": ["es2015", "stage-0", "react"],
  "plugins": ["transform-runtime"],
}

Options

the options is a object, and the value like this:

const Options = {
  entry: './src/index.js',  // your project entry file
  htmlTemplate: './src/index_template.html', // your html template file
};

so, use node server.js to start the local server in localhost: 3000

Demo

see the usage demo