50 lines
922 B
JavaScript
50 lines
922 B
JavaScript
const path = require('path')
|
|
|
|
var babelOptions = {
|
|
presets: ['@babel/preset-env'],
|
|
}
|
|
|
|
module.exports = {
|
|
// mode: 'production',
|
|
mode: 'development',
|
|
// entry: "./build/index.js",
|
|
entry: './src/index.ts',
|
|
// devtool: "inline-source-map",
|
|
target: 'web',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts?$/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
options: babelOptions,
|
|
},
|
|
{
|
|
loader: 'ts-loader',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
use: [
|
|
{
|
|
loader: 'babel-loader',
|
|
options: babelOptions,
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.tsx', '.ts', '.js'],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'jcchain.js',
|
|
library: 'jcchain',
|
|
libraryTarget: 'commonjs2',
|
|
// libraryTarget: 'window',
|
|
},
|
|
}
|