forked from boyska/radiomanifest.js
webpack builds oldstyle UMD js, too
This commit is contained in:
parent
9fc6c6a74b
commit
06fd8807b3
2 changed files with 24 additions and 12 deletions
|
@ -5,7 +5,7 @@
|
||||||
<body>
|
<body>
|
||||||
Ciao
|
Ciao
|
||||||
<script src="libs/ical.min.js"></script>
|
<script src="libs/ical.min.js"></script>
|
||||||
<script src="radiomanifest.js"></script>
|
<script src="dist/radiomanifest-oldstyle.bundle.js"></script>
|
||||||
<script src="ui.js"></script>
|
<script src="ui.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,15 +1,27 @@
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = ['web', 'node'].map(
|
const variants = [
|
||||||
target => ({
|
{ name: 'web', libtype: 'amd', target: 'web' },
|
||||||
name: target,
|
{ name: 'node', libtype: 'amd', target: 'node' },
|
||||||
mode: 'production',
|
{ name: 'oldstyle', libtype: 'umd', target: 'web' }
|
||||||
entry: './radiomanifest.js',
|
]
|
||||||
target: [target],
|
module.exports = variants.map(
|
||||||
output: {
|
variant => {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
const obj = {
|
||||||
filename: 'radiomanifest-' + target + '.bundle.js',
|
name: variant.name,
|
||||||
clean: false
|
mode: 'production',
|
||||||
|
entry: './radiomanifest.js',
|
||||||
|
target: [variant.target],
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__dirname, 'dist'),
|
||||||
|
filename: 'radiomanifest-' + variant.name + '.bundle.js',
|
||||||
|
clean: false,
|
||||||
|
library: {
|
||||||
|
name: 'radiomanifest',
|
||||||
|
type: variant.libtype
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
return obj
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue