mdast-util-wiki-link
Version:
Parse and render wiki-style links
55 lines (52 loc) • 1.05 kB
JavaScript
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default [
// ESM Configuration
{
mode: 'production',
entry: './src/index.ts',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'module',
},
experiments: {
outputModule: true,
},
},
// CommonJS Configuration
{
mode: 'production',
entry: './src/index.ts',
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
filename: 'index.cjs',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs2',
},
}
];