three.cad/webpack.common.js

47 lines
999 B
JavaScript
Raw 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: {
index: './src/index.js',
2021-03-30 23:20:24 +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-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: {
extensions: ['.js', '.jsx', '*']
2021-03-26 20:40:40 +00:00
},
2021-04-01 12:13:49 +00:00
};