three.cad/webpack.common.js

48 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2021-03-20 19:08:15 +00:00
const path = require('path');
2021-04-01 12:13:49 +00:00
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const tailwindcss = require('tailwindcss')
2021-03-20 19:08:15 +00:00
module.exports = {
2021-03-28 21:34:55 +00:00
entry: {
2021-04-07 22:50:53 +00:00
app: './src/react/app.jsx',
2021-04-26 07:25:47 +00:00
scene: './src/Scene.js',
2021-03-28 21:34:55 +00:00
},
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
2021-04-26 08:22:13 +00:00
// clean: true,
2021-03-28 21:34:55 +00:00
},
2021-04-01 12:13:49 +00:00
plugins: [new MiniCssExtractPlugin()],
2021-03-20 19:08:15 +00:00
module: {
rules: [
{
2021-04-01 08:20:50 +00:00
test: /\.css$/i,
2021-04-01 12:13:49 +00:00
use: [
MiniCssExtractPlugin.loader,
'css-loader',
{
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: [tailwindcss],
},
},
},
],
2021-03-20 19:08:15 +00:00
},
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-26 09:25:28 +00:00
}
}
},
2021-03-20 19:08:15 +00:00
],
},
2021-03-26 09:25:28 +00:00
resolve: {
2021-04-06 19:46:16 +00:00
extensions: ['.mjs', '.js', '.jsx', '*']
2021-03-26 20:40:40 +00:00
},
2021-04-01 12:13:49 +00:00
};