@live-codes/browser-compilers 0.4.13 → 0.4.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-codes/browser-compilers",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "description": "Compilers that run in the browser, for use in livecodes.io",
5
5
  "author": "Hatem Hosny",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@
39
39
  "react": "17.0.2",
40
40
  "react-dom": "17.0.2",
41
41
  "react-native-web": "0.17.5",
42
+ "sass": "1.49.7",
42
43
  "svelte": "3.44.1",
43
44
  "windicss": "3.2.1"
44
45
  },
@@ -51,7 +52,6 @@
51
52
  "autoprefixer": "10.4.0",
52
53
  "cz-conventional-changelog": "3.2.0",
53
54
  "esbuild": "0.11.12",
54
- "esbuild-plugin-replace": "1.0.6",
55
55
  "eslint": "7.32.0",
56
56
  "eslint-config-prettier": "6.11.0",
57
57
  "eslint-plugin-import": "2.20.2",
@@ -64,6 +64,28 @@ entryFiles.forEach(async (file) => {
64
64
  await parcelBundler.bundle();
65
65
  });
66
66
 
67
+ // sass
68
+ fs.readFile(path.resolve('node_modules/sass/sass.dart.js'), 'utf8', function (err, data) {
69
+ if (err) return console.log(err);
70
+
71
+ var result = data.replace(
72
+ 'var self = Object.create(dartNodePreambleSelf);',
73
+ 'var self = window;',
74
+ );
75
+
76
+ fs.writeFile(path.resolve('node_modules/sass/sass.dart.js'), result, 'utf8', function (err) {
77
+ if (err) return console.log(err);
78
+
79
+ esbuild.build({
80
+ ...baseOptions,
81
+ entryPoints: ['vendor_modules/imports/sass.ts'],
82
+ outfile: 'dist/sass/sass.js',
83
+ globalName: 'sass',
84
+ plugins: nodePolyfills,
85
+ });
86
+ });
87
+ });
88
+
67
89
  // Less
68
90
  esbuild.buildSync({
69
91
  ...baseOptions,
@@ -10,6 +10,8 @@ clientside-haml-js: [MIT License](https://github.com/uglyog/clientside-haml-js/b
10
10
 
11
11
  CoffeeScript: [MIT License](https://github.com/jashkenas/coffeescript/tree/07f644c39223e016aceedd2cd71b5941579b5659)
12
12
 
13
+ dart-sass: [MIT License](https://github.com/sass/dart-sass/blob/e3bf3eb3a3a8708877a86a08c7e3bee92160ac1f/LICENSE)
14
+
13
15
  gnuplot-JS: [MIT License](https://github.com/chhu/gnuplot-JS/blob/62a3c8488ad00c97807ba48ae75738ca3af607fe/LICENSE)
14
16
 
15
17
  JSCPP: [MIT License](https://github.com/felixhao28/JSCPP/blob/befbd6b48666007151c259c5dd291ab028ad4c04/LICENSE)
@@ -0,0 +1,16 @@
1
+ import sass from 'sass';
2
+
3
+ window.process = {
4
+ ...window.process,
5
+ stdout: {
6
+ write: (...data) => console.log(...data),
7
+ isTTY: false,
8
+ },
9
+ stderr: {
10
+ write: (...data) => console.warn(...data),
11
+ },
12
+ env: {},
13
+ };
14
+
15
+ export const compileString = sass.compileString;
16
+ export const compileStringAsync = sass.compileStringAsync;