小编Vik*_*kas的帖子

使用我使用 webpack -p 编译的快速服务器将构建部署到生产环境

我想将我的应用程序部署到生产环境。我不知道在使用 webpack -p 构建我的包后该怎么做。如何使用快速节点服务器在生产中提供此包。

我的 webpack.config.js 文件

var HtmlWebpackPlugin = require('html-webpack-plugin')
var debug = process.env.NODE_ENV !== "production";
var webpack = require("webpack");

var HTMLWebpackPluginConfig = new HtmlWebpackPlugin({
  template: __dirname + '/app/index.html',
  filename: 'index.html',
  inject: 'body'
});

module.exports = {
  devtool: debug ? "inline-sourcemap" : null,
  entry: [
    './app/index.js'
  ],
  output: {
    path: __dirname + '/dist',
    publicPath: '/',
    filename: "index_bundle.js"
  },
  module: {
    loaders: [
      {test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"}
    ]
  },
  resolve: {
    extensions: ['', '.js', '.jsx']
  },
  plugins: debug …
Run Code Online (Sandbox Code Playgroud)

deployment production config reactjs webpack

2
推荐指数
1
解决办法
2980
查看次数

标签 统计

config ×1

deployment ×1

production ×1

reactjs ×1

webpack ×1