Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Commit

Permalink
build(config/package): new build command and gulpfile changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimi-Gao committed May 30, 2018
1 parent 763f0dd commit 83cc5ef
Show file tree
Hide file tree
Showing 4 changed files with 1,139 additions and 37 deletions.
2 changes: 1 addition & 1 deletion config/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const gulp = require('gulp')
const replace = require('gulp-replace')

gulp.task('default', function () {
gulp.src('../lib/**/*.js')
gulp.src('../lib/components/**/*.js')
.pipe(replace(/require\('(\.\/)*(\.\.\/)*(\w+\/)*\w+\.less'\);/, ''))
.pipe(gulp.dest('../lib'))
})
26 changes: 21 additions & 5 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const sourcePath = path.resolve(__dirname, '../src')
const outputPath = path.resolve(__dirname, '../dist')
const entryName = `earth-ui`
const entryName = `earth-ui.min`

rimraf.sync(outputPath)

Expand All @@ -13,7 +13,8 @@ const config = {
output: {
path: outputPath,
publicPath: '../',
filename: '[name].js'
filename: '[name].js',
libraryTarget: 'umd'
},
module: {
rules: [{
Expand Down Expand Up @@ -47,9 +48,24 @@ const config = {
}
},
externals: {
'react': 'React',
'react-dom': 'ReactDOM',
'prop-types': 'PropTypes'
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
},
'prop-types': {
root: 'PropTypes',
commonjs2: 'prop-types',
commonjs: 'prop-types',
amd: 'prop-types'
}
},
plugins: [
new ExtractTextPlugin('[name].css'),
Expand Down

0 comments on commit 83cc5ef

Please sign in to comment.