diff --git a/index.js b/index.js index fea4285cc1..646ba516da 100644 --- a/index.js +++ b/index.js @@ -70,12 +70,4 @@ if (process.env.NODE_ENV !== 'production') { `antd@${antd.version} need react@${reactVersionInDeps} or higher.`); } -if (process.env.NODE_ENV !== 'production') { - const warning = require('warning'); - const semver = require('semver'); - const reactVersionInDeps = require('./package.json').devDependencies.react; - warning(semver.satisfies(React.version, reactVersionInDeps) || semver.gtr(React.version, reactVersionInDeps), - `antd@${antd.version} need react@${reactVersionInDeps} or higher.`); -} - module.exports = antd; diff --git a/package.json b/package.json index dd82adadc5..8fc805873e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.10.0-beta10", + "version": "0.10.0-beta14", "stableVersion": "0.9.3", "title": "Ant Design", "description": "一个 UI 设计语言", @@ -100,7 +100,7 @@ "webpack-dev-middleware": "^1.2.0" }, "scripts": { - "babel": "babel components --out-dir lib", + "babel": "babel components index.js --out-dir lib", "start": "npm run clean && nico server --watch", "clean": "rm -rf _site dist", "deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy", diff --git a/scripts/prenpm.js b/scripts/prenpm.js index b8bf19f343..d5762460b8 100644 --- a/scripts/prenpm.js +++ b/scripts/prenpm.js @@ -3,13 +3,17 @@ var cwd = process.cwd(); var path = require('path'); var pkg = require('../package'); -var originalIndex = fs.readFileSync(path.join(cwd, 'index.js'), 'utf-8'); +var originalIndex = fs.readFileSync(path.join(cwd, 'lib/index.js'), 'utf-8'); var newIndex = originalIndex .replace(/\/components\//g, '/') - .replace("require('./package.json').version", "require('./version')") + .replace(/require\(\'\.\/package.json\'\)/g, "require('./package')") .replace("require('./style/index.less')", "require('../style/index.less')"); fs.writeFileSync(path.join(cwd, 'lib/index.js'), newIndex, 'utf-8'); -fs.writeFileSync(path.join(cwd, 'lib/version.js'), "module.exports = '" + require('../package.json').version + "';", 'utf-8'); +fs.writeFileSync( + path.join(cwd, 'lib/package.js'), + "module.exports = " + JSON.stringify(require('../package.json')) + ";", + 'utf-8' +); var antdCss = path.join(cwd, 'dist/index.css'); fs.createReadStream(antdCss) .pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));