minesweeper/webpack.config.js

51 lines
1.4 KiB
JavaScript

const VersionFile = require("webpack-version-file");
module.exports = {
plugins: [
new VersionFile({
output: "./dist/index.html",
template: "./html/index.html",
package: "./package.json"
})
],
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: ["eslint-loader"]
},
{
test: /\.s[ac]ss$/i,
use: [
// Creates `style` nodes from JS strings
"style-loader",
// Translates CSS into CommonJS
"css-loader",
// Compiles Sass to CSS
"sass-loader",
],
},
{
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "res/fonts/"
}
}]
},
{
test: /\.(svg)$/,
use: [{
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "res/svg/"
}
}]
}
]
}
};