Commit 9e74a856f612bd1e54f41210e8b69b230de25391
1 parent
36fa7c6c
update webpack config
update webpack config
Showing
5 changed files
with
140 additions
and
154 deletions
Show diff stats
build/webpack.dev.config.js
| @@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
| 4 | 4 | ||
| 5 | var path = require('path'); | 5 | var path = require('path'); |
| 6 | var webpack = require('webpack'); | 6 | var webpack = require('webpack'); |
| 7 | -var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
| 8 | 7 | ||
| 9 | module.exports = { | 8 | module.exports = { |
| 10 | // 入口 | 9 | // 入口 |
| @@ -29,10 +28,8 @@ module.exports = { | @@ -29,10 +28,8 @@ module.exports = { | ||
| 29 | loader: 'vue-loader', | 28 | loader: 'vue-loader', |
| 30 | options: { | 29 | options: { |
| 31 | loaders: { | 30 | loaders: { |
| 32 | - css: ExtractTextPlugin.extract({ | ||
| 33 | - use: 'css-loader', | ||
| 34 | - fallback: 'vue-style-loader' // <- this is a dep of vue-loader, so no need to explicitly install if using npm3 | ||
| 35 | - }) | 31 | + css: 'vue-style-loader!css-loader', |
| 32 | + less: 'vue-style-loader!css-loader!less-loader' | ||
| 36 | }, | 33 | }, |
| 37 | postLoaders: { | 34 | postLoaders: { |
| 38 | html: 'babel-loader' | 35 | html: 'babel-loader' |
build/webpack.dist.dev.config.js
| @@ -22,29 +22,24 @@ module.exports = { | @@ -22,29 +22,24 @@ module.exports = { | ||
| 22 | } | 22 | } |
| 23 | }, | 23 | }, |
| 24 | resolve: { | 24 | resolve: { |
| 25 | - extensions: ['', '.js', '.vue'] | 25 | + extensions: ['.js', '.vue'] |
| 26 | }, | 26 | }, |
| 27 | module: { | 27 | module: { |
| 28 | - loaders: [{ | ||
| 29 | - test: /\.vue$/, | ||
| 30 | - loader: 'vue' | ||
| 31 | - }, { | ||
| 32 | - test: /\.js$/, | ||
| 33 | - loader: 'babel', | ||
| 34 | - exclude: /node_modules/ | ||
| 35 | - }, { | ||
| 36 | - test: /\.css$/, | ||
| 37 | - loader: 'style!css!autoprefixer' | ||
| 38 | - }, { | ||
| 39 | - test: /\.less$/, | ||
| 40 | - loader: 'style!css!less' | ||
| 41 | - }, { | ||
| 42 | - test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, | ||
| 43 | - loader: 'url?limit=8192' | ||
| 44 | - }, { | ||
| 45 | - test: /\.(html|tpl)$/, | ||
| 46 | - loader: 'vue-html' | ||
| 47 | - }] | 28 | + rules: [ |
| 29 | + { | ||
| 30 | + test: /\.vue$/, | ||
| 31 | + loader: 'vue-loader', | ||
| 32 | + options: { | ||
| 33 | + postLoaders: { | ||
| 34 | + html: 'babel-loader' | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + test: /\.js$/, | ||
| 40 | + loader: 'babel-loader', exclude: /node_modules/ | ||
| 41 | + } | ||
| 42 | + ] | ||
| 48 | }, | 43 | }, |
| 49 | plugins: [ | 44 | plugins: [ |
| 50 | new webpack.DefinePlugin({ | 45 | new webpack.DefinePlugin({ |
build/webpack.dist.prod.config.js
| @@ -22,29 +22,24 @@ module.exports = { | @@ -22,29 +22,24 @@ module.exports = { | ||
| 22 | } | 22 | } |
| 23 | }, | 23 | }, |
| 24 | resolve: { | 24 | resolve: { |
| 25 | - extensions: ['', '.js', '.vue'] | 25 | + extensions: ['.js', '.vue'] |
| 26 | }, | 26 | }, |
| 27 | module: { | 27 | module: { |
| 28 | - loaders: [{ | ||
| 29 | - test: /\.vue$/, | ||
| 30 | - loader: 'vue' | ||
| 31 | - }, { | ||
| 32 | - test: /\.js$/, | ||
| 33 | - loader: 'babel', | ||
| 34 | - exclude: /node_modules/ | ||
| 35 | - }, { | ||
| 36 | - test: /\.css$/, | ||
| 37 | - loader: 'style!css!autoprefixer' | ||
| 38 | - }, { | ||
| 39 | - test: /\.less$/, | ||
| 40 | - loader: 'style!css!less' | ||
| 41 | - }, { | ||
| 42 | - test: /\.(gif|jpg|png|woff|svg|eot|ttf)\??.*$/, | ||
| 43 | - loader: 'url?limit=8192' | ||
| 44 | - }, { | ||
| 45 | - test: /\.(html|tpl)$/, | ||
| 46 | - loader: 'vue-html' | ||
| 47 | - }] | 28 | + rules: [ |
| 29 | + { | ||
| 30 | + test: /\.vue$/, | ||
| 31 | + loader: 'vue-loader', | ||
| 32 | + options: { | ||
| 33 | + postLoaders: { | ||
| 34 | + html: 'babel-loader' | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + }, | ||
| 38 | + { | ||
| 39 | + test: /\.js$/, | ||
| 40 | + loader: 'babel-loader', exclude: /node_modules/ | ||
| 41 | + } | ||
| 42 | + ] | ||
| 48 | }, | 43 | }, |
| 49 | plugins: [ | 44 | plugins: [ |
| 50 | new webpack.DefinePlugin({ | 45 | new webpack.DefinePlugin({ |
package.json
| @@ -57,7 +57,6 @@ | @@ -57,7 +57,6 @@ | ||
| 57 | "css-loader": "^0.23.1", | 57 | "css-loader": "^0.23.1", |
| 58 | "eslint": "^3.12.2", | 58 | "eslint": "^3.12.2", |
| 59 | "eslint-plugin-html": "^1.7.0", | 59 | "eslint-plugin-html": "^1.7.0", |
| 60 | - "extract-text-webpack-plugin": "beta", | ||
| 61 | "file-loader": "^0.8.5", | 60 | "file-loader": "^0.8.5", |
| 62 | "gulp": "^3.9.1", | 61 | "gulp": "^3.9.1", |
| 63 | "gulp-autoprefixer": "^3.1.1", | 62 | "gulp-autoprefixer": "^3.1.1", |
src/index.js
| @@ -2,112 +2,112 @@ | @@ -2,112 +2,112 @@ | ||
| 2 | import 'core-js/fn/array/find-index'; | 2 | import 'core-js/fn/array/find-index'; |
| 3 | 3 | ||
| 4 | import Affix from './components/affix'; | 4 | import Affix from './components/affix'; |
| 5 | -import Alert from './components/alert'; | ||
| 6 | -import BackTop from './components/back-top'; | ||
| 7 | -import Badge from './components/badge'; | ||
| 8 | -import Breadcrumb from './components/breadcrumb'; | ||
| 9 | -import Button from './components/button'; | ||
| 10 | -import Card from './components/card'; | ||
| 11 | -import Carousel from './components/carousel'; | ||
| 12 | -import Cascader from './components/cascader'; | ||
| 13 | -import Checkbox from './components/checkbox'; | ||
| 14 | -import Circle from './components/circle'; | ||
| 15 | -import Collapse from './components/collapse'; | ||
| 16 | -import DatePicker from './components/date-picker'; | ||
| 17 | -import Dropdown from './components/dropdown'; | ||
| 18 | -import Form from './components/form'; | ||
| 19 | -import Icon from './components/icon'; | ||
| 20 | -import Input from './components/input'; | ||
| 21 | -import InputNumber from './components/input-number'; | ||
| 22 | -import LoadingBar from './components/loading-bar'; | ||
| 23 | -import Menu from './components/menu'; | ||
| 24 | -import Message from './components/message'; | ||
| 25 | -import Modal from './components/modal'; | ||
| 26 | -import Notice from './components/notice'; | ||
| 27 | -import Page from './components/page'; | ||
| 28 | -import Poptip from './components/poptip'; | ||
| 29 | -import Progress from './components/progress'; | ||
| 30 | -import Radio from './components/radio'; | ||
| 31 | -import Rate from './components/rate'; | ||
| 32 | -import Slider from './components/slider'; | ||
| 33 | -import Spin from './components/spin'; | ||
| 34 | -import Steps from './components/steps'; | ||
| 35 | -import Switch from './components/switch'; | ||
| 36 | -import Table from './components/table'; | ||
| 37 | -import Tabs from './components/tabs'; | ||
| 38 | -import Tag from './components/tag'; | ||
| 39 | -import Timeline from './components/timeline'; | ||
| 40 | -import TimePicker from './components/time-picker'; | ||
| 41 | -import Tooltip from './components/tooltip'; | ||
| 42 | -import Transfer from './components/transfer'; | ||
| 43 | -import Tree from './components/tree'; | ||
| 44 | -import Upload from './components/upload'; | ||
| 45 | -import { Row, Col } from './components/layout'; | ||
| 46 | -import { Select, Option, OptionGroup } from './components/select'; | 5 | +// import Alert from './components/alert'; |
| 6 | +// import BackTop from './components/back-top'; | ||
| 7 | +// import Badge from './components/badge'; | ||
| 8 | +// import Breadcrumb from './components/breadcrumb'; | ||
| 9 | +// import Button from './components/button'; | ||
| 10 | +// import Card from './components/card'; | ||
| 11 | +// import Carousel from './components/carousel'; | ||
| 12 | +// import Cascader from './components/cascader'; | ||
| 13 | +// import Checkbox from './components/checkbox'; | ||
| 14 | +// import Circle from './components/circle'; | ||
| 15 | +// import Collapse from './components/collapse'; | ||
| 16 | +// import DatePicker from './components/date-picker'; | ||
| 17 | +// import Dropdown from './components/dropdown'; | ||
| 18 | +// import Form from './components/form'; | ||
| 19 | +// import Icon from './components/icon'; | ||
| 20 | +// import Input from './components/input'; | ||
| 21 | +// import InputNumber from './components/input-number'; | ||
| 22 | +// import LoadingBar from './components/loading-bar'; | ||
| 23 | +// import Menu from './components/menu'; | ||
| 24 | +// import Message from './components/message'; | ||
| 25 | +// import Modal from './components/modal'; | ||
| 26 | +// import Notice from './components/notice'; | ||
| 27 | +// import Page from './components/page'; | ||
| 28 | +// import Poptip from './components/poptip'; | ||
| 29 | +// import Progress from './components/progress'; | ||
| 30 | +// import Radio from './components/radio'; | ||
| 31 | +// import Rate from './components/rate'; | ||
| 32 | +// import Slider from './components/slider'; | ||
| 33 | +// import Spin from './components/spin'; | ||
| 34 | +// import Steps from './components/steps'; | ||
| 35 | +// import Switch from './components/switch'; | ||
| 36 | +// import Table from './components/table'; | ||
| 37 | +// import Tabs from './components/tabs'; | ||
| 38 | +// import Tag from './components/tag'; | ||
| 39 | +// import Timeline from './components/timeline'; | ||
| 40 | +// import TimePicker from './components/time-picker'; | ||
| 41 | +// import Tooltip from './components/tooltip'; | ||
| 42 | +// import Transfer from './components/transfer'; | ||
| 43 | +// import Tree from './components/tree'; | ||
| 44 | +// import Upload from './components/upload'; | ||
| 45 | +// import { Row, Col } from './components/layout'; | ||
| 46 | +// import { Select, Option, OptionGroup } from './components/select'; | ||
| 47 | import locale from './locale'; | 47 | import locale from './locale'; |
| 48 | 48 | ||
| 49 | const iview = { | 49 | const iview = { |
| 50 | Affix, | 50 | Affix, |
| 51 | - Alert, | ||
| 52 | - BackTop, | ||
| 53 | - Badge, | ||
| 54 | - Breadcrumb, | ||
| 55 | - BreadcrumbItem: Breadcrumb.Item, | ||
| 56 | - iButton: Button, | ||
| 57 | - ButtonGroup: Button.Group, | ||
| 58 | - Card, | ||
| 59 | - Carousel, | ||
| 60 | - CarouselItem: Carousel.Item, | ||
| 61 | - Cascader, | ||
| 62 | - Checkbox, | ||
| 63 | - CheckboxGroup: Checkbox.Group, | ||
| 64 | - Circle, | ||
| 65 | - DatePicker, | ||
| 66 | - Dropdown, | ||
| 67 | - DropdownItem: Dropdown.Item, | ||
| 68 | - DropdownMenu: Dropdown.Menu, | ||
| 69 | - iForm: Form, | ||
| 70 | - FormItem: Form.Item, | ||
| 71 | - iCol: Col, | ||
| 72 | - Collapse, | ||
| 73 | - Icon, | ||
| 74 | - iInput: Input, | ||
| 75 | - InputNumber, | ||
| 76 | - LoadingBar, | ||
| 77 | - Menu, | ||
| 78 | - MenuGroup: Menu.Group, | ||
| 79 | - MenuItem: Menu.Item, | ||
| 80 | - Submenu: Menu.Sub, | ||
| 81 | - Message, | ||
| 82 | - Modal, | ||
| 83 | - Notice, | ||
| 84 | - iOption: Option, | ||
| 85 | - OptionGroup, | ||
| 86 | - Page, | ||
| 87 | - Panel: Collapse.Panel, | ||
| 88 | - Poptip, | ||
| 89 | - Progress, | ||
| 90 | - Radio, | ||
| 91 | - RadioGroup: Radio.Group, | ||
| 92 | - Rate, | ||
| 93 | - Row, | ||
| 94 | - iSelect: Select, | ||
| 95 | - Slider, | ||
| 96 | - Spin, | ||
| 97 | - Step: Steps.Step, | ||
| 98 | - Steps, | ||
| 99 | - Switch, | ||
| 100 | - iTable: Table, | ||
| 101 | - Tabs: Tabs, | ||
| 102 | - TabPane: Tabs.Pane, | ||
| 103 | - Tag, | ||
| 104 | - Timeline, | ||
| 105 | - TimelineItem: Timeline.Item, | ||
| 106 | - TimePicker, | ||
| 107 | - Tooltip, | ||
| 108 | - Transfer, | ||
| 109 | - Tree, | ||
| 110 | - Upload | 51 | + // Alert, |
| 52 | + // BackTop, | ||
| 53 | + // Badge, | ||
| 54 | + // Breadcrumb, | ||
| 55 | + // BreadcrumbItem: Breadcrumb.Item, | ||
| 56 | + // iButton: Button, | ||
| 57 | + // ButtonGroup: Button.Group, | ||
| 58 | + // Card, | ||
| 59 | + // Carousel, | ||
| 60 | + // CarouselItem: Carousel.Item, | ||
| 61 | + // Cascader, | ||
| 62 | + // Checkbox, | ||
| 63 | + // CheckboxGroup: Checkbox.Group, | ||
| 64 | + // Circle, | ||
| 65 | + // DatePicker, | ||
| 66 | + // Dropdown, | ||
| 67 | + // DropdownItem: Dropdown.Item, | ||
| 68 | + // DropdownMenu: Dropdown.Menu, | ||
| 69 | + // iForm: Form, | ||
| 70 | + // FormItem: Form.Item, | ||
| 71 | + // iCol: Col, | ||
| 72 | + // Collapse, | ||
| 73 | + // Icon, | ||
| 74 | + // iInput: Input, | ||
| 75 | + // InputNumber, | ||
| 76 | + // LoadingBar, | ||
| 77 | + // Menu, | ||
| 78 | + // MenuGroup: Menu.Group, | ||
| 79 | + // MenuItem: Menu.Item, | ||
| 80 | + // Submenu: Menu.Sub, | ||
| 81 | + // Message, | ||
| 82 | + // Modal, | ||
| 83 | + // Notice, | ||
| 84 | + // iOption: Option, | ||
| 85 | + // OptionGroup, | ||
| 86 | + // Page, | ||
| 87 | + // Panel: Collapse.Panel, | ||
| 88 | + // Poptip, | ||
| 89 | + // Progress, | ||
| 90 | + // Radio, | ||
| 91 | + // RadioGroup: Radio.Group, | ||
| 92 | + // Rate, | ||
| 93 | + // Row, | ||
| 94 | + // iSelect: Select, | ||
| 95 | + // Slider, | ||
| 96 | + // Spin, | ||
| 97 | + // Step: Steps.Step, | ||
| 98 | + // Steps, | ||
| 99 | + // Switch, | ||
| 100 | + // iTable: Table, | ||
| 101 | + // Tabs: Tabs, | ||
| 102 | + // TabPane: Tabs.Pane, | ||
| 103 | + // Tag, | ||
| 104 | + // Timeline, | ||
| 105 | + // TimelineItem: Timeline.Item, | ||
| 106 | + // TimePicker, | ||
| 107 | + // Tooltip, | ||
| 108 | + // Transfer, | ||
| 109 | + // Tree, | ||
| 110 | + // Upload | ||
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | const install = function (Vue, opts = {}) { | 113 | const install = function (Vue, opts = {}) { |
| @@ -118,10 +118,10 @@ const install = function (Vue, opts = {}) { | @@ -118,10 +118,10 @@ const install = function (Vue, opts = {}) { | ||
| 118 | Vue.component(key, iview[key]); | 118 | Vue.component(key, iview[key]); |
| 119 | }); | 119 | }); |
| 120 | 120 | ||
| 121 | - Vue.prototype.$Loading = LoadingBar; | ||
| 122 | - Vue.prototype.$Message = Message; | ||
| 123 | - Vue.prototype.$Modal = Modal; | ||
| 124 | - Vue.prototype.$Notice = Notice; | 121 | + // Vue.prototype.$Loading = LoadingBar; |
| 122 | + // Vue.prototype.$Message = Message; | ||
| 123 | + // Vue.prototype.$Modal = Modal; | ||
| 124 | + // Vue.prototype.$Notice = Notice; | ||
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | // auto install | 127 | // auto install |