Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 86d76be

Browse files
author
daniel.gomez
committed
Added build script
1 parent af09aad commit 86d76be

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.idea
2+
/lib
23
/node_modules

‎.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/src
2+
# Created by .ignore support plugin (hsz.mobi)

‎package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "redux-autoform-utils",
3-
"version": "1.0.0",
3+
"version": "1.0.2",
44
"description": "Common javascript files to all the redux-autoform related projects",
5-
"main": "index.js",
5+
"main": "./lib/index.js",
66
"scripts": {
7+
"build-lib": "babel-node ./tools/build-lib.js",
78
"test": "mocha ./test --compilers js:babel-register"
89
},
910
"repository": {
@@ -37,6 +38,11 @@
3738
"babel-preset-react": "^6.5.0",
3839
"babel-preset-stage-0": "^6.5.0",
3940
"chai": "^3.5.0",
40-
"mocha": "^2.5.3"
41+
"child-process-promise": "^2.0.3",
42+
"colors": "^1.1.2",
43+
"fs-extra-promise": "^0.4.0",
44+
"mocha": "^2.5.3",
45+
"path": "^0.12.7",
46+
"rimraf-promise": "^2.0.0"
4147
}
4248
}

‎tools/build-lib.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import path from 'path';
2+
import fsep from 'fs-extra-promise';
3+
import rimraf from 'rimraf-promise';
4+
import colors from 'colors';
5+
import { exec } from 'child-process-promise';
6+
7+
const repoRoot = path.resolve(__dirname, '../');
8+
const lib = path.join(repoRoot, 'lib');
9+
const lessSrc = path.join(repoRoot, '/src/less');
10+
const lessDest = path.join(lib, '/less');
11+
12+
console.log('building lib'.green);
13+
14+
rimraf(lib)
15+
.then(function (error) {
16+
let babelCli = '"./node_modules/.bin/babel" src -d lib';
17+
return exec(babelCli).fail(function (error) {
18+
console.log(colors.red(error))
19+
});
20+
})
21+
.then(() => fsep.copyAsync(lessSrc, lessDest))
22+
.then(() => console.log('lib built'.green));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /