Create 'static' directory for serving from flask

This commit is contained in:
Tristan Maat 2018-04-15 23:11:24 +00:00
parent 92050e27ea
commit c0fab723dc
3 changed files with 15 additions and 6 deletions

View file

@ -1,7 +1,7 @@
{ {
"hash": true, "hash": true,
"title": "tlater.net", "title": "tlater.net",
"filename": "./index.html", "filename": "../index.html",
"template": "./src/index/index.pug", "template": "./src/index/index.pug",
"chunks": ["index"] "chunks": ["index"]
} }

View file

@ -1,7 +1,7 @@
{ {
"hash": true, "hash": true,
"title": "tlater.net contact", "title": "tlater.net contact",
"filename": "./mail.html", "filename": "../mail.html",
"template": "./src/mail/mail.pug", "template": "./src/mail/mail.pug",
"chunks": ["mail"] "chunks": ["mail"]
} }

View file

@ -18,11 +18,12 @@ const pages = page_files.map(page => JSON.parse(fs.readFileSync(
module.exports = { module.exports = {
entry: { entry: {
index: "./src/index/index.js", index: "./src/index/index.js",
mail: "./src/mail/mail.js" mail: "./src/mail/mail.js",
startpage: "./src/startpage/startpage.js"
}, },
output: { output: {
filename: "[name].bundle.js", filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist") path: path.resolve(__dirname, "dist", "static")
}, },
plugins: [ plugins: [
new CleanWebpackPlugin("dist"), new CleanWebpackPlugin("dist"),
@ -47,7 +48,12 @@ module.exports = {
{ {
test: /.scss$/, test: /.scss$/,
use: [{ use: [{
loader: MiniCssExtractPlugin.loader loader: MiniCssExtractPlugin.loader,
options: {
output: {
path: path.resolve(__dirname, "dist", "static")
}
}
}, { }, {
loader: "css-loader" loader: "css-loader"
}, { }, {
@ -77,7 +83,10 @@ module.exports = {
{ {
test: /\.(eot|svg|ttf|woff|woff2)$/, test: /\.(eot|svg|ttf|woff|woff2)$/,
use: [{ use: [{
loader: "file-loader" loader: "file-loader",
options: {
outputPath: "static"
}
}] }]
} }
] ]