mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
fix prepublish script
This commit is contained in:
parent
8e3ac6b6a5
commit
1108336633
@ -1,11 +1,16 @@
|
||||
var fs = require('fs');
|
||||
var cwd = process.cwd();
|
||||
var path = require('path');
|
||||
var pkg = require('../package');
|
||||
|
||||
var originalIndex = fs.readFileSync(path.join(cwd, 'index.js'), 'utf-8');
|
||||
var newIndex = originalIndex
|
||||
.replace(/\/components\//g, '/')
|
||||
.replace("require('./package.json').version", "'" + require('../package.json').version + "'")
|
||||
.replace("require('./style/index.less')", "require('./index.css')");
|
||||
fs.writeFileSync(path.join(cwd, 'lib/index.js'), newIndex, 'utf-8');
|
||||
fs.createReadStream(path.join(cwd, 'dist/antd.css')).pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
|
||||
|
||||
var antdCss = path.join(cwd, 'dist/' + pkg.name + '-' + pkg.version + '.css');
|
||||
fs.createReadStream(antdCss)
|
||||
.pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
|
||||
console.log('prenpm done');
|
@ -5,9 +5,6 @@ var webpack = require("webpack");
|
||||
var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
var config = require("./webpack.config.js");
|
||||
|
||||
config.plugins = [
|
||||
new ExtractTextPlugin('[name].css')
|
||||
];
|
||||
delete config.entry.demo;
|
||||
delete config.entry[pkg.name];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user