Create 'static' directory for serving from flask

pull/1/head
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,
"title": "tlater.net",
"filename": "./index.html",
"filename": "../index.html",
"template": "./src/index/index.pug",
"chunks": ["index"]
}

View File

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

View File

@ -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"
}
}]
}
]