54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
const path = require('path');
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
module.exports = {
|
|
entry: './index.js',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'main.js',
|
|
clean: true,
|
|
library: {
|
|
name: 'CGSelect',
|
|
type: 'window',
|
|
export: 'default',
|
|
},
|
|
},
|
|
// devServer: {
|
|
// open: true,
|
|
// port: 5500,
|
|
// },
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/i,
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
},
|
|
{
|
|
test: /\.(?:js|mjs|cjs)$/,
|
|
exclude: /node_modules/,
|
|
use: {
|
|
loader: 'babel-loader',
|
|
options: {
|
|
presets: [['@babel/preset-env', { targets: 'defaults' }]],
|
|
plugins: ['@babel/plugin-proposal-class-properties'],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
// plugins: [
|
|
// new HtmlWebpackPlugin({
|
|
// template: path.resolve(__dirname, './test/index.html'),
|
|
// filename: 'index.html',
|
|
// }),
|
|
// ],
|
|
};
|