@ixon-cdk/svelte-builder 1.19.0 → 1.20.0

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.
Files changed (3) hide show
  1. package/browser.js +23 -6
  2. package/index.js +2 -1
  3. package/package.json +2 -2
package/browser.js CHANGED
@@ -16,7 +16,15 @@ const {
16
16
  watchAssets,
17
17
  } = require('@ixon-cdk/core');
18
18
 
19
- async function _build(inputFile, outputFile, tag, assets, production, watch) {
19
+ async function _build(
20
+ inputFile,
21
+ outputFile,
22
+ tag,
23
+ assets,
24
+ production,
25
+ watch,
26
+ sourceMap,
27
+ ) {
20
28
  const inputDir = path.dirname(path.join(getRootDir(), inputFile));
21
29
  const outputDir = path.dirname(path.join(getRootDir(), outputFile));
22
30
 
@@ -49,7 +57,7 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
49
57
  name: 'app',
50
58
  fileName: () => `${tag}.min.js`,
51
59
  },
52
- sourcemap: !production,
60
+ sourcemap: sourceMap,
53
61
  outDir: outputDir,
54
62
  emptyOutDir: false,
55
63
  rollupOptions: {
@@ -68,7 +76,7 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
68
76
  immutable: true,
69
77
  tag,
70
78
  },
71
- preprocess: preprocess({ sourceMap: !production }),
79
+ preprocess: preprocess({ sourceMap }),
72
80
  }),
73
81
  ],
74
82
  };
@@ -80,7 +88,7 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
80
88
  // @rollup/plugin-typescript complains about compiler options, when the input directory doesn't contain any `.ts` files.
81
89
  if (fs.existsSync(tsConfig) && dirContains(inputDir, '**/*.ts')) {
82
90
  const typescriptPlugin = typescript({
83
- sourceMap: !production,
91
+ sourceMap,
84
92
  outDir: outputDir,
85
93
  tsconfig: tsConfig,
86
94
  include: inputDir,
@@ -112,7 +120,7 @@ async function _build(inputFile, outputFile, tag, assets, production, watch) {
112
120
  // watch source files
113
121
  if (watch) {
114
122
  watchAssets(assets, inputDir, outputDir);
115
- await watchInputDir(inputDir, isAsset => {
123
+ watchInputDir(inputDir, isAsset => {
116
124
  if (isAsset) {
117
125
  // do nothing
118
126
  } else {
@@ -156,6 +164,15 @@ module.exports = function runBuild(
156
164
  assets,
157
165
  production = true,
158
166
  watch = false,
167
+ sourceMap = true,
159
168
  ) {
160
- return _build(inputFile, outputFile, tag, assets, production, watch);
169
+ return _build(
170
+ inputFile,
171
+ outputFile,
172
+ tag,
173
+ assets,
174
+ production,
175
+ watch,
176
+ sourceMap,
177
+ );
161
178
  };
package/index.js CHANGED
@@ -11,6 +11,7 @@ function main() {
11
11
  const output = argv.output || 'dist/bundle/main.min.js';
12
12
  const assets = JSON.parse(argv.assets || '[]');
13
13
  const watch = !!argv.watch;
14
+ const sourceMap = !!argv.sourceMap;
14
15
 
15
16
  if (!input) {
16
17
  logErrorMessage(
@@ -32,7 +33,7 @@ function main() {
32
33
  }
33
34
 
34
35
  if (buildTarget === 'browser') {
35
- require('./browser')(input, output, tag, assets, true, watch);
36
+ require('./browser')(input, output, tag, assets, true, watch, sourceMap);
36
37
  }
37
38
  }
38
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixon-cdk/svelte-builder",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "",
@@ -17,6 +17,6 @@
17
17
  "vite": "^4.5.3"
18
18
  },
19
19
  "peerDependencies": {
20
- "@ixon-cdk/core": "^1.19.0"
20
+ "@ixon-cdk/core": "^1.20.0"
21
21
  }
22
22
  }