inkjs-linux/webpack.config.js

61 lines
1.3 KiB
JavaScript
Raw Normal View History

const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const CopyPlugin = require('copy-webpack-plugin');
2021-08-14 10:21:51 +03:00
const ExecaPlugin = require("execa-webpack-plugin");
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: [
'./js/script.js',
2020-11-07 11:40:32 +02:00
'./scss/style.scss'
],
plugins: [
2021-08-14 09:58:24 +03:00
new MiniCssExtractPlugin(),
2021-08-14 10:21:51 +03:00
new ExecaPlugin({
onBeforeRun: [
{
cmd: "inklecate",
args: ["game/fogg.ink"],
options: {
cwd: process.cwd()
}
}
]
}),
new CopyPlugin({
patterns: [
{ from: './html/', to: '' },
2021-08-14 10:21:51 +03:00
{ from: './game/*.json', to: '' },
],
}),
],
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
},
{
test: /\.s[ac]ss$/i,
use: [
2021-08-14 09:58:24 +03:00
MiniCssExtractPlugin.loader,
// Translates CSS into CommonJS
'css-loader',
'postcss-loader',
// Compiles Sass to CSS
'sass-loader'
]
2020-11-07 11:40:32 +02:00
},
]
},
output: {
path: path.resolve(__dirname, 'build')
}
}