three.cad/webpack.common.js

44 lines
877 B
JavaScript

const path = require('path');
module.exports = {
entry: {
index: './src/index.js',
renderer: './src/Renderer.js',
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
},
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",
],
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ["@babel/preset-react"],
plugins: ["@babel/plugin-proposal-class-properties"]
}
}
},
],
},
resolve: {
extensions: ['.js', '.jsx', '*']
},
};