mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 17:43:00 +08:00
Misc fixes
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
dist
|
||||
docs
|
||||
example
|
||||
|
||||
@@ -29,7 +29,7 @@ module.exports = function (config) {
|
||||
preprocessors: {
|
||||
'src/specs.bundle.js': [ 'webpack', 'sourcemap' ]
|
||||
},
|
||||
reporters: [ process.env.TRAVIS ? 'dots' : 'progress' ],
|
||||
reporters: [ 'dots' ],
|
||||
singleRun: true,
|
||||
webpack: assign({}, webpackConfig, { devtool: 'inline' }),
|
||||
webpackMiddleware: {
|
||||
|
||||
@@ -3,6 +3,20 @@ var base = require('./webpack-base.config.js')
|
||||
var webpack = require('webpack')
|
||||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin
|
||||
|
||||
var plugins = []
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
plugins.push(
|
||||
new UglifyJsPlugin({
|
||||
compress: {
|
||||
dead_code: true,
|
||||
drop_console: true,
|
||||
screw_ie8: true,
|
||||
warnings: true
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = assign({}, base, {
|
||||
entry: {
|
||||
main: './src/index'
|
||||
@@ -16,14 +30,5 @@ module.exports = assign({}, base, {
|
||||
libraryTarget: 'commonjs2',
|
||||
path: './dist'
|
||||
},
|
||||
plugins: [
|
||||
new UglifyJsPlugin({
|
||||
compress: {
|
||||
dead_code: true,
|
||||
drop_console: true,
|
||||
screw_ie8: true,
|
||||
warnings: true
|
||||
}
|
||||
})
|
||||
]
|
||||
plugins: plugins
|
||||
})
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"scripts": {
|
||||
"prepublish": "NODE_ENV=production npm run build",
|
||||
"build": "rm -rf ./dist && webpack --config config/webpack.config.js --sort-assets-by --progress",
|
||||
"example": "cd example && webpack --config webpack.config.js",
|
||||
"lint": "eslint .",
|
||||
"specs": "NODE_ENV=test karma start config/karma.config.js",
|
||||
"specs:watch": "npm run specs -- --no-single-run",
|
||||
@@ -16,7 +17,9 @@
|
||||
"test": "npm run specs && npm run lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^0.13.3"
|
||||
"react": "^0.13.3",
|
||||
"react-swipeable": "^3.0.2",
|
||||
"react-tappable": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer-core": "^5.2.1",
|
||||
|
||||
16
src/index.js
16
src/index.js
@@ -1,16 +1,24 @@
|
||||
import React from 'react'
|
||||
|
||||
// components
|
||||
import Image from './modules/Image'
|
||||
import Text from './modules/Text'
|
||||
import TextInput from './modules/TextInput'
|
||||
import View from './modules/View'
|
||||
import Image from './components/Image'
|
||||
import ListView from './components/ListView'
|
||||
import ScrollView from './components/ScrollView'
|
||||
import Swipeable from './components/Swipeable'
|
||||
import Text from './components/Text'
|
||||
import TextInput from './components/TextInput'
|
||||
import Touchable from './components/Touchable'
|
||||
import View from './components/View'
|
||||
|
||||
export default React
|
||||
|
||||
export {
|
||||
Image,
|
||||
ListView,
|
||||
ScrollView,
|
||||
Swipeable,
|
||||
Text,
|
||||
TextInput,
|
||||
Touchable,
|
||||
View
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user