2023-03-31 14:51:02 +03:00
|
|
|
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
2023-04-06 15:14:30 +03:00
|
|
|
entry: './index.js',
|
2023-03-31 14:51:02 +03:00
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2023-04-06 15:14:30 +03:00
|
|
|
filename: 'main.js',
|
2023-03-31 14:51:02 +03:00
|
|
|
clean: true,
|
2023-04-13 12:46:11 +03:00
|
|
|
library: {
|
|
|
|
name: 'CGSelect',
|
|
|
|
type: 'window',
|
|
|
|
export: 'default',
|
|
|
|
},
|
2023-03-31 14:51:02 +03:00
|
|
|
},
|
2023-04-06 15:14:30 +03:00
|
|
|
// devServer: {
|
|
|
|
// open: true,
|
|
|
|
// port: 5500,
|
|
|
|
// },
|
2023-03-31 14:51:02 +03:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.s[ac]ss$/i,
|
|
|
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
|
|
},
|
2023-04-06 15:14:30 +03:00
|
|
|
{
|
|
|
|
test: /\.(?:js|mjs|cjs)$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [['@babel/preset-env', { targets: 'defaults' }]],
|
|
|
|
plugins: ['@babel/plugin-proposal-class-properties'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-03-31 14:51:02 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
|
|
},
|
2023-04-06 15:14:30 +03:00
|
|
|
// plugins: [
|
|
|
|
// new HtmlWebpackPlugin({
|
|
|
|
// template: path.resolve(__dirname, './test/index.html'),
|
|
|
|
// filename: 'index.html',
|
|
|
|
// }),
|
|
|
|
// ],
|
2023-03-31 14:51:02 +03:00
|
|
|
};
|