8000 fix: add umd version · coreui/coreui-utils@8b60f4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b60f4a

Browse files
committed
fix: add umd version
1 parent b2c3cdf commit 8b60f4a

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

dist/coreui-utils.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/utils",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "CoreUI utility functions",
55
"sideEffects": false,
66
"keywords": [

src/index.umd.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* --------------------------------------------------------------------------
3+
* CoreUI (v3.0.0-rc.0): index.umd.js
4+
* Licensed under MIT (https://coreui.io/license)
5+
* --------------------------------------------------------------------------
6+
*/
7+
8+
import deepObjectsMerge from './deep-objects-merge'
9+
import getColor from './get-color'
10+
import getStyle from './get-style'
11+
import hexToRgb from './hex-to-rgb'
12+
import hexToRgba from './hex-to-rgba'
13+
import makeUid from './make-uid'
14+
import pickByKeys from './pick-by-keys'
15+
import rgbToHex from './rgb-to-hex'
16+
17+
export default {
18+
deepObjectsMerge,
19+
getColor,
20+
getStyle,
21+
hexToRgb,
22+
hexToRgba,
23+
makeUid,
24+
pickByKeys,
25+
rgbToHex
26+
}

webpack.config.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path')
22

3-
module.exports = {
3+
const commonJSConfig = {
44
entry: './src/index.js',
55
output: {
66
path: path.resolve(__dirname, 'dist'),
@@ -19,4 +19,30 @@ module.exports = {
1919
}
2020
}]
2121
}
22-
}
22+
}
23+
24+
const umdConfig = {
25+
entry: './src/index.umd.js',
26+
output: {
27+
path: path.resolve(__dirname, 'dist'),
28+
filename: 'coreui-utils.js',
29+
library: ['coreui', 'Utils'],
30+
libraryExport: 'default',
31+
libraryTarget: 'umd',
32+
globalObject: 'this'
33+
},
34+
module: {
35+
rules: [{
36+
test: /\.js$/,
37+
exclude: /(node_modules)/,
38+
use: {
39+
loader: 'babel-loader',
40+
options: {
41+
presets: ['@babel/preset-env']
42+
}
43+
}
44+
}]
45+
}
46+
}
47+
48+
module.exports = [commonJSConfig, umdConfig]

0 commit comments

Comments
 (0)
0