mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-03 20:18:11 +08:00
further webpack config cleanup
This commit is contained in:
@@ -22,10 +22,6 @@ module.exports = {
|
||||
filename: "static/js/bundle.js",
|
||||
publicPath: "/"
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".js", ".json"],
|
||||
modules: ["node_modules"]
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
@@ -80,18 +76,6 @@ module.exports = {
|
||||
template: path.resolve("index.html"),
|
||||
favicon: path.resolve("favicon.png")
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
options: {
|
||||
eslint: {
|
||||
configFile: path.resolve("./configuration/eslint/eslint.js"),
|
||||
useEslintrc: false
|
||||
},
|
||||
postcss() {
|
||||
return [autoprefixer];
|
||||
}
|
||||
}
|
||||
}),
|
||||
new webpack.DefinePlugin({ "process.env.NODE_ENV": '"development"' }),
|
||||
// Note: only CSS is currently hot reloaded
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
|
||||
@@ -5,9 +5,7 @@ const webpack = require("webpack");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
||||
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin");
|
||||
const MinifyPlugin = require("babel-minify-webpack-plugin");
|
||||
|
||||
const src = path.resolve("src");
|
||||
const nodeModules = path.resolve("node_modules");
|
||||
@@ -17,23 +15,22 @@ const publicPath = "/";
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
bail: true,
|
||||
// TODO: causes a js error, need to update to whatever webpack4 wants
|
||||
// devtool: "cheap-source-map",
|
||||
cache: false,
|
||||
devtool: "cheap-source-map",
|
||||
// XXX todo: why are we using our own polyfill and not babel-polyfill?
|
||||
entry: [require.resolve("../polyfills/polyfills"), path.join(src, "index")],
|
||||
output: {
|
||||
path: path.resolve("build"),
|
||||
filename: "static/js/[name].[chunkhash:8].js",
|
||||
chunkFilename: "static/js/[name].[chunkhash:8].chunk.js",
|
||||
// chunkFilename: "static/js/[name].[chunkhash:8].chunk.js",
|
||||
publicPath
|
||||
},
|
||||
resolve: { extensions: [".js", ".json"] },
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: src,
|
||||
loader: "babel-loader",
|
||||
// query: require("../babel/babel.prod")
|
||||
options: require("../babel/babel.prod")
|
||||
},
|
||||
{
|
||||
@@ -102,20 +99,6 @@ module.exports = {
|
||||
}
|
||||
}),
|
||||
new HtmlWebpackInlineSourcePlugin(),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
options: {
|
||||
eslint: {
|
||||
configFile: path.resolve("./configuration/eslint/eslint.js"),
|
||||
useEslintrc: false
|
||||
},
|
||||
postcss() {
|
||||
return [autoprefixer];
|
||||
}
|
||||
}
|
||||
}),
|
||||
new webpack.DefinePlugin({ "process.env.NODE_ENV": '"production"' }),
|
||||
new webpack.optimize.OccurrenceOrderPlugin(),
|
||||
new MinifyPlugin(),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "static/css/[name].[contenthash:8].css"
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user