Skip to content

Commit d0604d9

Browse files
committed
build dist
1 parent a1ff87f commit d0604d9

File tree

8 files changed

+27
-36
lines changed

8 files changed

+27
-36
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ var FormControl = require('rctui/FormControl')
2020
import Input from 'rctui/Input'
2121
```
2222

23+
If you don't want compile the file or encounter any compile problems, you can use the built file
24+
```
25+
import { Form } from 'rctui/dist'
26+
27+
```
28+
or use unpkg cdn
29+
```
30+
// html
31+
<script src="https://unpkg.com/rctui/dist/index.js"></script>
32+
// webpack config
33+
externals: {'react': 'React', 'react-dom': 'ReactDOM', 'rctui': 'rctui'},
34+
// jsx
35+
import { Form } from 'rctui'
36+
...
37+
38+
```
39+
40+
2341
# cli
2442
There is a internal cli command, help you easy start you app.
2543

build/Form.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

build/ReactUI.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/build/ReactUI.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rctui",
33
"author": "lobos841@gmail.com",
4-
"version": "0.7.11",
4+
"version": "0.7.12",
55
"description": "a collection of components for React",
66
"main": "./src/index.js",
77
"scripts": {

src/Image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Image extends Component {
8282
const { title, type } = this.props
8383

8484
return type === 'fill' || type === 'fit'
85-
? <div className={_styles.inner} title={title} style={{backgroundImage: `url(${src})`}} />
85+
? <div className={_styles.inner} title={title} style={{backgroundImage: `url("${src}")`}} />
8686
: <div className={_styles.inner} title={title}><img src={src} /></div>
8787
}
8888

src/Upload/ImgUpload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ImgUpload extends Component {
9090
let url = substitute(srcTpl, v)
9191
return (
9292
<li key={i} style={{width, height}}>
93-
<div className={_styles.img} style={{backgroundImage: `url(${url})`}}>
93+
<div className={_styles.img} style={{backgroundImage: `url("${url}")`}}>
9494
<a href="javascript:;" onClick={() => removeValue(i)}>
9595
<span>{getLang('buttons.remove')} &times;</span>
9696
</a>

webpack.config.prod.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin')
66

77
module.exports = {
88
entry: {
9-
ReactUI: './src/index'
9+
index: './src/index'
1010
},
1111
output: {
12-
path: path.join(__dirname, 'build'),
12+
path: path.join(__dirname, 'dist'),
1313
libraryTarget: 'umd',
14-
library: '[name]',
14+
library: 'rctui',
1515
filename: '[name].js'
1616
},
1717
externals: {'react': 'React', 'react-dom': 'ReactDOM'},
@@ -36,15 +36,13 @@ module.exports = {
3636
screw_ie8: true
3737
}
3838
}),
39-
new ExtractTextPlugin('build/[name].css')
39+
new ExtractTextPlugin('[name].css')
4040
],
4141
module: {
4242
loaders: [
4343
{ test: /\.jsx?$/, loaders: ['babel'] },
44-
{ test: /\.scss$/, loader: ExtractTextPlugin.extract('style', ['css?modules&localIdentName=[hash:base64:8]', 'postcss', 'sass']) }
45-
],
46-
preLoaders: [
47-
{ test: /\.scss$/, loader: 'rctui-theme-loader?theme=' }
44+
{ test: /\.scss$/, loaders: ['style-loader', 'css-loader?modules&localIdentName=[name]-[local]', 'postcss-loader', 'sass-loader'] }
45+
// { test: /\.scss$/, loader: ExtractTextPlugin.extract('style', ['css?modules&localIdentName=[hash:base64:8]', 'postcss', 'sass']) }
4846
]
4947
},
5048
postcss: function () {

0 commit comments

Comments
 (0)