Skip to content

Commit f854238

Browse files
committed
bootstrap development environment
1 parent 233d558 commit f854238

File tree

5 files changed

+134
-0
lines changed

5 files changed

+134
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
continuation_indent_size = 2
6+
end_of_line = lf
7+
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
/node_modules

package.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@myuw-web-components/myuw-widget-launch-button",
3+
"version": "0.0.1",
4+
"description": "Stylized hyperlink to launch from a widget.",
5+
"module": "dist/myuw-widget-launch-button.min.mjs",
6+
"browser": "dist/myuw-widget-launch-button.min.js",
7+
"scripts": {
8+
"build": "rollup -c",
9+
"watch": "rollup -c -w",
10+
"serve": "live-server",
11+
"start": "run-p watch serve",
12+
"sonar": "sonar-scanner",
13+
"prepare": "npm run build"
14+
},
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/myuw-web-components/myuw-widget-launch-button.git"
18+
},
19+
"author": "",
20+
"license": "Apache-2.0",
21+
"bugs": {
22+
"url": "https://github.com/myuw-web-components/myuw-widget-launch-button/issues"
23+
},
24+
"homepage": "https://github.com/myuw-web-components/myuw-widget-launch-button",
25+
"devDependencies": {
26+
"@babel/core": "^7.7.2",
27+
"@babel/preset-env": "^7.7.1",
28+
"live-server": "^1.2.1",
29+
"mime-types": "^2.1.25",
30+
"npm-run-all": "^4.1.5",
31+
"rollup": "^1.27.1",
32+
"rollup-plugin-babel": "^4.3.3",
33+
"rollup-plugin-html": "^0.2.1",
34+
"rollup-plugin-minify-es": "^1.1.1",
35+
"sonarqube-scanner": "^2.5.0",
36+
"tota11y": "^0.1.6"
37+
},
38+
"files": [
39+
"dist"
40+
]
41+
}

rollup.config.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import html from 'rollup-plugin-html';
2+
import minify from 'rollup-plugin-minify-es';
3+
import babel from 'rollup-plugin-babel';
4+
5+
let fileName = 'myuw-widget-launch-button';
6+
let objName = 'MyUWWidgetLaunchButton';
7+
8+
let plugins = {
9+
full: [
10+
html({
11+
include: `src/*.html`,
12+
htmlMinifierOptions: {
13+
collapseWhitespace: true,
14+
collapseBooleanAttributes: true,
15+
conservativeCollapse: true
16+
}
17+
})
18+
],
19+
min: [
20+
html({
21+
include: `src/*.html`,
22+
htmlMinifierOptions: {
23+
collapseWhitespace: true,
24+
collapseBooleanAttributes: true,
25+
conservativeCollapse: true
26+
}
27+
}),
28+
minify({
29+
output: {
30+
wrap_iife: true
31+
}
32+
})
33+
]
34+
};
35+
36+
export default [
37+
{
38+
input: `src/${fileName}.js`,
39+
plugins: plugins.full.concat([babel({exclude: 'node_modules/**'})]),
40+
output: {
41+
file: `dist/${fileName}.js`,
42+
name: objName,
43+
format: 'iife'
44+
}
45+
},
46+
{
47+
input: `src/${fileName}.js`,
48+
plugins: plugins.min.concat([babel({exclude: 'node_modules/**'})]),
49+
output: {
50+
file: `dist/${fileName}.min.js`,
51+
name: objName,
52+
format: 'iife'
53+
}
54+
},
55+
{
56+
input: `src/${fileName}.js`,
57+
plugins: plugins.full,
58+
output: {
59+
file: `dist/${fileName}.mjs`,
60+
name: objName,
61+
format: 'es'
62+
}
63+
},
64+
{
65+
input: `src/${fileName}.js`,
66+
plugins: plugins.min,
67+
output: {
68+
file: `dist/${fileName}.min.mjs`,
69+
name: objName,
70+
format: 'es'
71+
}
72+
},
73+
];

src/.babelrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["@babel/env", {
4+
"modules": false
5+
}]
6+
],
7+
}

0 commit comments

Comments
 (0)