From c0fab723dcd00efdef66fc3d6017fff9622421ac Mon Sep 17 00:00:00 2001 From: Tristan Maat Date: Sun, 15 Apr 2018 23:11:24 +0000 Subject: [PATCH] Create 'static' directory for serving from flask --- src/pages/index.json | 2 +- src/pages/mail.json | 2 +- webpack.common.js | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/pages/index.json b/src/pages/index.json index 237c082..709714e 100644 --- a/src/pages/index.json +++ b/src/pages/index.json @@ -1,7 +1,7 @@ { "hash": true, "title": "tlater.net", - "filename": "./index.html", + "filename": "../index.html", "template": "./src/index/index.pug", "chunks": ["index"] } diff --git a/src/pages/mail.json b/src/pages/mail.json index 675d2b7..5b88f62 100644 --- a/src/pages/mail.json +++ b/src/pages/mail.json @@ -1,7 +1,7 @@ { "hash": true, "title": "tlater.net contact", - "filename": "./mail.html", + "filename": "../mail.html", "template": "./src/mail/mail.pug", "chunks": ["mail"] } diff --git a/webpack.common.js b/webpack.common.js index 1888614..e24d8f7 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -18,11 +18,12 @@ const pages = page_files.map(page => JSON.parse(fs.readFileSync( module.exports = { entry: { index: "./src/index/index.js", - mail: "./src/mail/mail.js" + mail: "./src/mail/mail.js", + startpage: "./src/startpage/startpage.js" }, output: { filename: "[name].bundle.js", - path: path.resolve(__dirname, "dist") + path: path.resolve(__dirname, "dist", "static") }, plugins: [ new CleanWebpackPlugin("dist"), @@ -47,7 +48,12 @@ module.exports = { { test: /.scss$/, use: [{ - loader: MiniCssExtractPlugin.loader + loader: MiniCssExtractPlugin.loader, + options: { + output: { + path: path.resolve(__dirname, "dist", "static") + } + } }, { loader: "css-loader" }, { @@ -77,7 +83,10 @@ module.exports = { { test: /\.(eot|svg|ttf|woff|woff2)$/, use: [{ - loader: "file-loader" + loader: "file-loader", + options: { + outputPath: "static" + } }] } ]