46 lines
1.1 KiB
JavaScript
46 lines
1.1 KiB
JavaScript
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
export default {
|
|
mode: 'development',
|
|
entry: './src/client/index.js',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
publicPath: '/ac/'
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js/,
|
|
resolve: {
|
|
fullySpecified: false
|
|
}
|
|
},
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader'
|
|
}
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader']
|
|
}
|
|
]
|
|
},
|
|
plugins: [
|
|
new HtmlWebpackPlugin({
|
|
template: './src/client/index.html'
|
|
})
|
|
],
|
|
resolve: {
|
|
extensions: ['.js', '.jsx']
|
|
}
|
|
};
|