@m2c2kit/cli 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,73 +0,0 @@
1
- import typescript from "@rollup/plugin-typescript";
2
- import nodeResolve from "@rollup/plugin-node-resolve";
3
- import serve from "rollup-plugin-serve";
4
- import livereload from "rollup-plugin-livereload";
5
- import copy from "rollup-plugin-copy";
6
- import { hashM2c2kitAssets } from "@m2c2kit/build-helpers";
7
-
8
- export default (commandLineArgs) => {
9
- const isDebug = commandLineArgs.configServe ? true : false;
10
- const isProduction = commandLineArgs.configProd ? true : false;
11
-
12
- let outputFolder = "build";
13
- if (isProduction) {
14
- outputFolder = "dist";
15
- }
16
-
17
- const finalConfig = [
18
- {
19
- input: "./src/index.ts",
20
- output: [
21
- {
22
- file: `./${outputFolder}/index.js`,
23
- format: "es",
24
- sourcemap: isDebug,
25
- sourcemapExcludeSources: true
26
- },
27
- ],
28
- plugins: [
29
- nodeResolve(),
30
- typescript({
31
- sourceMap: isDebug && true,
32
- }),
33
- copy({
34
- targets: [
35
- {
36
- src: "./src/assets",
37
- dest: outputFolder,
38
- },
39
- {
40
- src: "./src/index.html",
41
- dest: outputFolder,
42
- },
43
- ],
44
- }),
45
- isProduction &&
46
- !commandLineArgs.configNoHash &&
47
- hashM2c2kitAssets(outputFolder),
48
- isDebug &&
49
- serve({
50
- /**
51
- * Start development server and automatically open browser with
52
- * npm run serve -- --configOpen
53
- * However, to debug and hit breakpoints, you must launch
54
- * the browser through vs code.
55
- */
56
- open: commandLineArgs.configOpen && true,
57
- verbose: true,
58
- contentBase: [`./${outputFolder}`],
59
- historyApiFallback: true,
60
- host: "localhost",
61
- port: 3000,
62
- }),
63
- isDebug &&
64
- /**
65
- * Try a shorter delay for quicker reloads, but increase it if
66
- * the browser reloads before the new build is fully ready.
67
- */
68
- livereload({ watch: "build", delay: 250 }),
69
- ],
70
- },
71
- ];
72
- return finalConfig;
73
- };
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es6",
4
- "lib": ["es6", "dom", "dom.iterable"],
5
- "module": "es6",
6
- "moduleResolution": "node",
7
- "allowJs": true,
8
- "esModuleInterop": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "strict": true,
11
- "outDir": "build",
12
- "rootDir": "src",
13
- "skipLibCheck": true,
14
- },
15
- "include": ["./src/**/*.ts", "./src/**/*.js"]
16
- }