63 lines
1.5 KiB
JavaScript
63 lines
1.5 KiB
JavaScript
const path = require("path");
|
|
|
|
const miniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
const autoprefixer = require('autoprefixer');
|
|
|
|
module.exports = {
|
|
entry: {
|
|
api: "./assets/js/api.js",
|
|
scene: "./assets/js/scene.js",
|
|
editor: "./assets/js/editor.js",
|
|
frontend: "./assets/js/frontend.js",
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, "static/js"),
|
|
filename: "[name].bundle.js",
|
|
},
|
|
plugins: [new miniCssExtractPlugin()],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.js$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: "babel-loader",
|
|
options: {
|
|
presets: ["@babel/preset-env"],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"],
|
|
},
|
|
{
|
|
test: /\.scss$/,
|
|
use: [
|
|
{
|
|
// Adds CSS to the DOM by injecting a `<style>` tag
|
|
loader: "style-loader",
|
|
},
|
|
{
|
|
// Interprets `@import` and `url()` like `import/require()` and will resolve them
|
|
loader: "css-loader",
|
|
},
|
|
{
|
|
// Loader for webpack to process CSS with PostCSS
|
|
loader: "postcss-loader",
|
|
options: {
|
|
postcssOptions: {
|
|
plugins: [autoprefixer],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
// Loads a SASS/SCSS file and compiles it to CSS
|
|
loader: "sass-loader",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
};
|