Server render auto-index pages
Also, load the autoIndex bundle on the client so we can use React instead of using an inline script.
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
const path = require("path");
|
||||
const webpack = require("webpack");
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
main: path.resolve(__dirname, "client/main.js")
|
||||
main: path.resolve(__dirname, "./server/client/main.js"),
|
||||
autoIndex: path.resolve(__dirname, "./server/client/autoIndex.js")
|
||||
},
|
||||
|
||||
externals: {
|
||||
@ -21,7 +23,13 @@ module.exports = {
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.js$/, exclude: /node_modules/, use: "babel-loader" },
|
||||
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: "css-loader"
|
||||
})
|
||||
},
|
||||
{ test: /\.md$/, use: ["html-loader", "markdown-loader"] },
|
||||
{ test: /\.png$/, use: "file-loader" }
|
||||
]
|
||||
@ -32,7 +40,8 @@ module.exports = {
|
||||
"process.env.NODE_ENV": JSON.stringify(
|
||||
process.env.NODE_ENV || "development"
|
||||
)
|
||||
})
|
||||
}),
|
||||
new ExtractTextPlugin("[name]-[hash:8].css")
|
||||
],
|
||||
|
||||
devtool:
|
||||
|
||||
Reference in New Issue
Block a user