three.cad/webpack.common.js

44 lines
877 B
JavaScript
Raw Normal View History

2021-03-20 19:08:15 +00:00
const path = require('path');
module.exports = {
2021-03-28 21:34:55 +00:00
entry: {
index: './src/index.js',
renderer: './src/Renderer.js',
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
},
2021-03-20 19:08:15 +00:00
module: {
rules: [
{
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",
],
},
2021-03-26 09:25:28 +00:00
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
2021-03-26 20:40:40 +00:00
presets: ["@babel/preset-react"],
2021-03-29 10:27:34 +00:00
plugins: ["@babel/plugin-proposal-class-properties"]
2021-03-26 09:25:28 +00:00
}
}
},
2021-03-20 19:08:15 +00:00
],
},
2021-03-26 09:25:28 +00:00
resolve: {
extensions: ['.js', '.jsx', '*']
2021-03-26 20:40:40 +00:00
},
2021-03-20 19:08:15 +00:00
};