2020-05-15 14:16:13 +00:00
|
|
|
/* eslint-env node */
|
|
|
|
|
|
|
|
const path = require('path')
|
2020-05-19 10:01:42 +00:00
|
|
|
const { commonLoaders } = require('../webpack/common')
|
2020-05-15 14:16:13 +00:00
|
|
|
|
|
|
|
const common = {
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.tsx', '.js']
|
|
|
|
},
|
|
|
|
mode: 'development',
|
|
|
|
entry: path.resolve(__dirname, 'source', 'index.ts'),
|
|
|
|
module: {
|
2020-05-19 17:31:04 +00:00
|
|
|
rules: commonLoaders({ file: false })
|
2020-05-15 14:16:13 +00:00
|
|
|
},
|
|
|
|
externals:
|
|
|
|
// Every non-relative module is external
|
|
|
|
/^[a-z\-0-9]+$/
|
|
|
|
}
|
|
|
|
|
2020-05-19 10:01:42 +00:00
|
|
|
module.exports =
|
2020-05-15 14:16:13 +00:00
|
|
|
// Config for UMD export (browser / node)
|
|
|
|
{
|
|
|
|
...common,
|
|
|
|
output: {
|
|
|
|
filename: 'index.js',
|
|
|
|
library: 'publicodes',
|
|
|
|
libraryTarget: 'umd',
|
|
|
|
globalObject: 'this'
|
|
|
|
}
|
|
|
|
}
|