isomorfeus-asset-manager 0.19.4 → 0.19.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f11e4c25b7b2cb0aa55e7e27237634900dd0fe52413781aada3257bdc8a17838
4
- data.tar.gz: 2e3bbb990cbf3c22063ec79c7dd5eb0e897799c0c9fbbfcb3c887ebd78653856
3
+ metadata.gz: 4be3eb8ec0f4c7a71098a5e24e674e6f5cc009feab9823279c0fc5f77475a566
4
+ data.tar.gz: 5e8b06eca8613334a6a68c9429294c78c10d535c383e65eefc1b81b43dd23d1c
5
5
  SHA512:
6
- metadata.gz: 40d7d80558e5eb3f15e9333a6c04d5ec337376f5c6012c6b7c83d6ea8ab35b9bae5bcd2ca40bfd0b4d5614eaaf48c2bc40d3dae3111d0c67ef27080ae5a8415b
7
- data.tar.gz: 4efd4bc22112dbf9013c200056b257ced598b1670e7efe0af528bf970dfe32ab6451abb75f3c16b792fb94ebc660ca4a7389aa2e83d91b4d6a537306d5ff9d0d
6
+ metadata.gz: ca5b8cc4745fd9a3c3385ba2344c751f4c580ad31852008a53c401c18c004f83839eb308861fdac5a59ecbfc54c38b22f69018568c7d9d160406107374ba23f8
7
+ data.tar.gz: fbd95f8dcac26cb1126d0741d6ac92d92f40d125871edea988ad2cb7437ae8d1bb78c6a690bac2b6916d433719e6e61fa776dfe373c67da5b7ac10be6f520fe5
data/README.md CHANGED
@@ -15,4 +15,7 @@ However, if within the project the 'esbuild' npm package is installed in node_mo
15
15
  At the [Isomorfeus Framework Project](https://isomorfeus.com)
16
16
 
17
17
  ### Targets
18
- By default Isomorfeus Asset Manager bundles for browsers using the 'es6' target and for node using the 'node16' target of esbuild.
18
+ By default Isomorfeus Asset Manager bundles for browsers using the 'es6' target and for node using the 'node18' target of esbuild.
19
+
20
+ ### SASS
21
+ For SASS support, installing the [esbuild-sass-plugin](https://www.npmjs.com/package/esbuild-sass-plugin) is enough, it will be automatically loaded when available in the node load path, eg. in node_modules of the project.
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  class AssetManager
3
- VERSION = '0.19.4'
3
+ VERSION = '0.19.5'
4
4
  end
5
5
  end
@@ -84,6 +84,9 @@ module Isomorfeus
84
84
  try { esbuild_r = require('esbuild'); }
85
85
  catch { esbuild_r = require('esbuild-wasm'); }
86
86
  const esbuild = esbuild_r;
87
+ try { esbuild_r = require('esbuild-sass-plugin'); }
88
+ catch { esbuild_r = null; }
89
+ const esbuild_sass_plugin = esbuild_r;
87
90
  global.imports_path = '#{@imports_path}';
88
91
  global.output_path = '#{@output_path}';
89
92
  JAVASCRIPT
@@ -148,7 +151,7 @@ module Isomorfeus
148
151
  entryPoints: [path.resolve(global.imports_path, '#{entry}')],
149
152
  bundle: true,
150
153
  color: false,
151
- format: '#{asset.node? ? 'cjs' : 'iife'}',
154
+ format: '#{asset.node? ? "cjs" : "iife"}',
152
155
  legalComments: 'linked',
153
156
  loader: { '.svg': 'text', '.png': 'dataurl' },
154
157
  logLimit: 0,
@@ -157,15 +160,17 @@ module Isomorfeus
157
160
  nodePaths: #{resolve_paths},
158
161
  outdir: global.output_path,
159
162
  platform: '#{asset.target}',
163
+ plugins: (esbuild_sass_plugin ? [esbuild_sass_plugin()] : []),
160
164
  publicPath: '#{asset.browser? ? Isomorfeus.assets_path : @output_path}',
161
165
  sourcemap: #{(!Isomorfeus.production? && asset.browser?) ? 'true' : 'false'},
162
166
  splitting: false,
163
- target: '#{asset.browser? ? 'es6' : 'node16' }',
167
+ target: '#{asset.browser? ? 'es6' : 'node18' }',
164
168
  write: true
165
169
  })
166
170
  .then((result) => { global.res_meta = result.metafile; return result; }, (reason) => { return { result: { errors: [{text: reason}]}}; })
167
171
  .catch((error) => { return { result: { errors: [{text: error.message}]}}; });
168
172
  JAVASCRIPT
173
+
169
174
  if analyze
170
175
  analysis = context.await <<~JAVASCRIPT
171
176
  esbuild.analyzeMetafile(global.res_meta, { verbose: true });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-asset-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.4
4
+ version: 0.19.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-09 00:00:00.000000000 Z
11
+ date: 2023-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brotli