@s-ui/bundler 9.71.0 → 9.73.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.
package/README.md CHANGED
@@ -167,6 +167,8 @@ This tool works with zero configuration out the box but you could use some confi
167
167
 
168
168
  `targets`: Object with information about the browser and version supported. (default: `see the next example`)
169
169
 
170
+ `disableTypeScriptLoader`: Flag to determine if typescript loader should be used. (default: `false`)
171
+
170
172
  ```json
171
173
  {
172
174
  "config": {
@@ -184,7 +186,8 @@ This tool works with zero configuration out the box but you could use some confi
184
186
  "sourcemaps": {
185
187
  "dev": "cheap-module-eval-source-map",
186
188
  "prod": "hidden-source-map"
187
- }
189
+ },
190
+ "disableTypeScriptLoader": true // Only if you want to disable typescript loader
188
191
  }
189
192
  }
190
193
  }
@@ -291,8 +294,7 @@ If in your CSS you have:
291
294
  ```css
292
295
  #app {
293
296
  color: blue;
294
- background: url('https://spa-mock-statics.surge.sh/images/common/sprite-sheet/sprite-ma.png')
295
- no-repeat scroll;
297
+ background: url('https://spa-mock-statics.surge.sh/images/common/sprite-sheet/sprite-ma.png') no-repeat scroll;
296
298
  }
297
299
  ```
298
300
 
@@ -301,17 +303,15 @@ After compile you will get:
301
303
  ```css
302
304
  #app {
303
305
  color: #00f;
304
- background: url(https://spa-mock-statics.surge.sh/images/common/sprite-sheet/sprite-ma.72d1edb214.png)
305
- no-repeat scroll;
306
+ background: url(https://spa-mock-statics.surge.sh/images/common/sprite-sheet/sprite-ma.72d1edb214.png) no-repeat
307
+ scroll;
306
308
  }
307
309
  ```
308
310
 
309
311
  Or if in your JS you have:
310
312
 
311
313
  ```jsx
312
- <img
313
- src={'https://spa-mock-statics.surge.sh/images/common/mis-anuncios2.gif'}
314
- />
314
+ <img src={'https://spa-mock-statics.surge.sh/images/common/mis-anuncios2.gif'} />
315
315
  ```
316
316
 
317
317
  After compile will be:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s-ui/bundler",
3
- "version": "9.71.0",
3
+ "version": "9.73.0",
4
4
  "description": "Config-free bundler for ES6 React apps.",
5
5
  "bin": {
6
6
  "sui-bundler": "./bin/sui-bundler.js"
@@ -26,8 +26,8 @@ const getTSConfig = () => {
26
26
 
27
27
  module.exports = ({isServer = false, isDevelopment = false, supportLegacyBrowsers = true} = {}) => {
28
28
  const tsConfig = getTSConfig()
29
- // If TS config exists in root dir, set TypeScript as enabled.
30
- const isTypeScriptEnabled = Boolean(tsConfig)
29
+ // If config.disableTypeScriptLoader is not true and TS config exists in root dir, set TypeScript as enabled.
30
+ const isTypeScriptEnabled = !config.disableTypeScriptLoader && Boolean(tsConfig)
31
31
 
32
32
  return isTypeScriptEnabled
33
33
  ? {
@@ -21,7 +21,7 @@ const createCompilerRules = require('./shared/module-rules-compiler.js')
21
21
 
22
22
  const outputPath = path.join(process.cwd(), '.sui/public')
23
23
 
24
- const {CI = false, PWD = '', CDN} = process.env
24
+ const {CI = false, CDN} = process.env
25
25
 
26
26
  process.env.NODE_ENV = 'development'
27
27
 
@@ -30,7 +30,7 @@ process.env.NODE_ENV = 'development'
30
30
  const webpackConfig = {
31
31
  name: 'client',
32
32
  mode: 'development',
33
- context: path.resolve(PWD, 'src'),
33
+ context: path.resolve(process.cwd(), 'src'),
34
34
  resolve: {
35
35
  alias: {
36
36
  ...defaultAlias,
@@ -16,7 +16,7 @@ const createCompilerRules = require('./shared/module-rules-compiler.js')
16
16
 
17
17
  const outputPath = path.join(process.cwd(), 'dist')
18
18
 
19
- const {CI = false, PWD = ''} = process.env
19
+ const {CI = false} = process.env
20
20
 
21
21
  process.env.NODE_ENV = 'development'
22
22
 
@@ -25,7 +25,7 @@ process.env.NODE_ENV = 'development'
25
25
  const webpackConfig = {
26
26
  name: 'client-local',
27
27
  mode: 'development',
28
- context: path.resolve(PWD, 'src'),
28
+ context: path.resolve(process.cwd(), 'src'),
29
29
  resolve: {
30
30
  alias: {
31
31
  ...defaultAlias,