further webpack config cleanup

This commit is contained in:
bkmartinjr
2018-08-13 17:07:53 -07:00
parent 4e80ed6c5d
commit 34561a3b08
4 changed files with 12 additions and 46 deletions
@@ -22,10 +22,6 @@ module.exports = {
filename: "static/js/bundle.js", filename: "static/js/bundle.js",
publicPath: "/" publicPath: "/"
}, },
resolve: {
extensions: [".js", ".json"],
modules: ["node_modules"]
},
module: { module: {
rules: [ rules: [
{ {
@@ -80,18 +76,6 @@ module.exports = {
template: path.resolve("index.html"), template: path.resolve("index.html"),
favicon: path.resolve("favicon.png") 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 // Note: only CSS is currently hot reloaded
new webpack.HotModuleReplacementPlugin(), new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin() new webpack.NoEmitOnErrorsPlugin()
@@ -5,9 +5,7 @@ const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin"); const SWPrecacheWebpackPlugin = require("sw-precache-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin"); const HtmlWebpackInlineSourcePlugin = require("html-webpack-inline-source-plugin");
const MinifyPlugin = require("babel-minify-webpack-plugin");
const src = path.resolve("src"); const src = path.resolve("src");
const nodeModules = path.resolve("node_modules"); const nodeModules = path.resolve("node_modules");
@@ -17,23 +15,22 @@ const publicPath = "/";
module.exports = { module.exports = {
mode: "production", mode: "production",
bail: true, bail: true,
// TODO: causes a js error, need to update to whatever webpack4 wants cache: false,
// devtool: "cheap-source-map", 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")], entry: [require.resolve("../polyfills/polyfills"), path.join(src, "index")],
output: { output: {
path: path.resolve("build"), path: path.resolve("build"),
filename: "static/js/[name].[chunkhash:8].js", filename: "static/js/[name].[chunkhash:8].js",
chunkFilename: "static/js/[name].[chunkhash:8].chunk.js", // chunkFilename: "static/js/[name].[chunkhash:8].chunk.js",
publicPath publicPath
}, },
resolve: { extensions: [".js", ".json"] },
module: { module: {
rules: [ rules: [
{ {
test: /\.js$/, test: /\.js$/,
include: src, include: src,
loader: "babel-loader", loader: "babel-loader",
// query: require("../babel/babel.prod")
options: require("../babel/babel.prod") options: require("../babel/babel.prod")
}, },
{ {
@@ -102,20 +99,6 @@ module.exports = {
} }
}), }),
new HtmlWebpackInlineSourcePlugin(), 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({ new MiniCssExtractPlugin({
filename: "static/css/[name].[contenthash:8].css" filename: "static/css/[name].[contenthash:8].css"
}), }),
+8 -8
View File
@@ -2,11 +2,14 @@
"name": "cellxgene", "name": "cellxgene",
"version": "0.0.1", "version": "0.0.1",
"license": "MIT", "license": "MIT",
"description": "cellxgene is a web application for the interactive exploration of single cell sequence data.", "description":
"cellxgene is a web application for the interactive exploration of single cell sequence data.",
"repository": "https://github.com/chanzuckerberg/cellxgene", "repository": "https://github.com/chanzuckerberg/cellxgene",
"scripts": { "scripts": {
"build": "npm run clean && webpack --config configuration/webpack/webpack.config.prod.js", "build":
"dev": "npm run clean && webpack --config configuration/webpack/webpack.config.dev.js", "npm run clean && webpack --config configuration/webpack/webpack.config.prod.js",
"dev":
"npm run clean && webpack --config configuration/webpack/webpack.config.dev.js",
"clean": "rimraf build", "clean": "rimraf build",
"start": "node server/development.js", "start": "node server/development.js",
"lint": "eslint src", "lint": "eslint src",
@@ -57,7 +60,6 @@
"babel-core": "^6.13.2", "babel-core": "^6.13.2",
"babel-eslint": "^8.2.6", "babel-eslint": "^8.2.6",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.2",
"babel-minify-webpack-plugin": "^0.3.1",
"babel-plugin-istanbul": "^3.1.2", "babel-plugin-istanbul": "^3.1.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-react-constant-elements": "^6.9.1", "babel-plugin-transform-react-constant-elements": "^6.9.1",
@@ -83,7 +85,7 @@
"file-loader": "^1.1.11", "file-loader": "^1.1.11",
"html-webpack-inline-source-plugin": "0.0.10", "html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"jest": "^23.4.1", "jest": "^23.5.0",
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"mini-css-extract-plugin": "^0.4.1", "mini-css-extract-plugin": "^0.4.1",
"nyc": "^13.0.1", "nyc": "^13.0.1",
@@ -101,9 +103,7 @@
"webpack-hot-middleware": "^2.22.3" "webpack-hot-middleware": "^2.22.3"
}, },
"jest": { "jest": {
"testMatch": [ "testMatch": ["**/__tests__/**/?(*.)(spec|test).js?(x)"],
"**/__tests__/**/?(*.)(spec|test).js?(x)"
],
"testURL": "http://localhost/" "testURL": "http://localhost/"
} }
} }
-1
View File
@@ -1 +0,0 @@
module.exports = {};