mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
update index
This commit is contained in:
parent
1afb9b543d
commit
6a6cc8228a
9
index.js
9
index.js
@ -1,4 +1,6 @@
|
||||
import React from 'react';
|
||||
// this file is not used if use https://github.com/ant-design/babel-plugin-antd
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const antd = {
|
||||
Affix: require('./components/affix'),
|
||||
@ -47,10 +49,9 @@ const antd = {
|
||||
Cascader: require('./components/cascader'),
|
||||
};
|
||||
|
||||
antd.version = require('./package.json').version;
|
||||
|
||||
const ReactVersion = React.version;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
antd.version = require('./package.json').version;
|
||||
const ReactVersion = React.version;
|
||||
const warning = require('warning');
|
||||
const semver = require('semver');
|
||||
const reactVersionInDeps = require('./package.json').devDependencies.react;
|
||||
|
@ -1,18 +1,10 @@
|
||||
var fs = require('fs');
|
||||
var cwd = process.cwd();
|
||||
var path = require('path');
|
||||
var pkg = require('../package');
|
||||
|
||||
var originalIndex = fs.readFileSync(path.join(cwd, 'lib/index.js'), 'utf-8');
|
||||
var newIndex = originalIndex
|
||||
.replace(/\/components\//g, '/')
|
||||
.replace(/require\(\'\.\/package.json\'\)/g, "require('./package')");
|
||||
.replace(/\/components\//g, '/');
|
||||
fs.writeFileSync(path.join(cwd, 'lib/index.js'), newIndex, '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/antd.css');
|
||||
fs.createReadStream(antdCss)
|
||||
.pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
|
||||
|
Loading…
Reference in New Issue
Block a user