Skip to content

Commit 3efd194

Browse files
committed
🐛 Fix build script.
1 parent c7d06d1 commit 3efd194

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

build/.gitkeep

Whitespace-only changes.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "requirex-postcss-bundle",
33
"version": "0.0.1",
44
"description": "PostCSS bundled for requirex",
5-
"main": "dist/index.min.js",
5+
"main": "dist/index.js",
6+
"browser": "dist/index.min.js",
67
"scripts": {
78
"tsc": "tsc",
89
"prepublish": "node src/build.js src/index.ts > build/index.js && tsc -p src && tsc --allowJs -m commonjs --outDir dist build/index.js && uglifyjs -c -m < dist/index.js > dist/index.min.js"

src/build.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
require('requirex');
1+
var path = require('path');
2+
var url = require('requirex').URL;
23

3-
System.build(require('path').resolve(process.argv[2])).then(function(code) {
4+
var resolved = url.fromLocal(path.resolve(process.argv[2]));
5+
var parent = url.resolve(resolved, '.');
6+
7+
System.build(resolved, parent).then(function(code) {
48
process.stdout.write(code);
59
});

0 commit comments

Comments
 (0)