{"action":"created","issue":{"url":"https://api.github.com/repos/museui/muse-ui/issues/108","repository_url":"https://api.github.com/repos/museui/muse-ui","labels_url":"https://api.github.com/repos/museui/muse-ui/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/museui/muse-ui/issues/108/comments","events_url":"https://api.github.com/repos/museui/muse-ui/issues/108/events","html_url":"https://github.com/museui/muse-ui/issues/108","id":192227764,"number":108,"title":"单个组件加载时,js中引入base.less报错","user":{"login":"bboywulong","id":17426924,"avatar_url":"https://avatars.githubusercontent.com/u/17426924?v=3","gravatar_id":"","url":"https://api.github.com/users/bboywulong","html_url":"https://github.com/bboywulong","followers_url":"https://api.github.com/users/bboywulong/followers","following_url":"https://api.github.com/users/bboywulong/following{/other_user}","gists_url":"https://api.github.com/users/bboywulong/gists{/gist_id}","starred_url":"https://api.github.com/users/bboywulong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboywulong/subscriptions","organizations_url":"https://api.github.com/users/bboywulong/orgs","repos_url":"https://api.github.com/users/bboywulong/repos","events_url":"https://api.github.com/users/bboywulong/events{/privacy}","received_events_url":"https://api.github.com/users/bboywulong/received_events","type":"User","site_admin":false},"labels":[{"id":486471179,"url":"https://api.github.com/repos/museui/muse-ui/labels/need%20repo","name":"need repo","color":"b60205","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-29T09:20:17Z","updated_at":"2016-11-29T09:53:39Z","closed_at":"2016-11-29T09:50:25Z","body":"我按照文档单独使用组件,引入base.less时候webpack报错,less和less-load我配置过了\r\n```\r\nERROR in ./~/.0.25.0@css-loader!./~/.2.2.3@less-loader!./~/.0.13.1@style-loader!./~/.0.25.0@css-loader!./~/.2.2.3@less-loader!./~/.2.0.0-alpha.10@muse-ui/src/styles/base.less\r\nModule build failed: Unrecognised input\r\n @ /Users/randylee/Desktop/work02/Cgj-WeChat/node_modules/.2.0.0-alpha.10@muse-ui/src/styles/base.less (line 4, column 12)\r\n near lines:\r\n   // load the styles\r\n   var content = require(\"!!./../../../.0.25.0@css-loader/index.js!./../../../.2.2.3@less-loader/index.js!./base.less\");\r\n   if(typeof content === 'string') content = [[module.id, content, '']];\r\n @ ./~/.2.0.0-alpha.10@muse-ui/src/styles/base.less 4:14-235 13:2-17:4 14:20-241\r\n```"},"comment":{"url":"https://api.github.com/repos/museui/muse-ui/issues/comments/263525700","html_url":"https://github.com/museui/muse-ui/issues/108#issuecomment-263525700","issue_url":"https://api.github.com/repos/museui/muse-ui/issues/108","id":263525700,"user":{"login":"bboywulong","id":17426924,"avatar_url":"https://avatars.githubusercontent.com/u/17426924?v=3","gravatar_id":"","url":"https://api.github.com/users/bboywulong","html_url":"https://github.com/bboywulong","followers_url":"https://api.github.com/users/bboywulong/followers","following_url":"https://api.github.com/users/bboywulong/following{/other_user}","gists_url":"https://api.github.com/users/bboywulong/gists{/gist_id}","starred_url":"https://api.github.com/users/bboywulong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboywulong/subscriptions","organizations_url":"https://api.github.com/users/bboywulong/orgs","repos_url":"https://api.github.com/users/bboywulong/repos","events_url":"https://api.github.com/users/bboywulong/events{/privacy}","received_events_url":"https://api.github.com/users/bboywulong/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T09:53:39Z","updated_at":"2016-11-29T09:53:39Z","body":"```\r\nimport Vue from 'vue'\r\nimport App from './App'\r\nimport router from './router'\r\nimport store from './store'\r\nimport VueResource from 'vue-resource'\r\nimport { sync } from 'vuex-router-sync'\r\n// import MuseUI from './muse-user/muse'\r\n\r\nimport 'muse-components/styles/base.less'\r\nimport {retina} from 'muse-components/utils'\r\nimport appbar from 'muse-components/appBar'\r\nimport avatar from 'muse-components/avatar'\r\nimport iconButton from 'muse-components/iconButton'\r\nimport {list, listItem} from 'muse-components/list'\r\n\r\nretina()\r\n\r\nVue.component(appbar.name, appbar)\r\nVue.component(avatar.name, avatar)\r\nVue.component(iconButton.name, iconButton)\r\nVue.component(list.name, list)\r\nVue.component(listItem.name, listItem)\r\n\r\n// 开启debug模式\r\nVue.config.debug = true\r\nsync(store, router)\r\n\r\nVue.use(VueResource)\r\n// Vue.use(MuseUI)\r\n\r\nstore.commit('increment')\r\nconsole.log(store.state.count)\r\n\r\n// 现在我们可以启动应用了！\r\n// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。\r\nnew Vue({\r\n  store,\r\n  router,\r\n  render: h => h(App)\r\n}).$mount('#app')\r\n\r\n```\r\n\r\n```\r\nmodule.exports = {\r\n  entry: {\r\n    app: './src/main.js',\r\n    vendor: ['vue', 'vue-router', 'vuex', 'vuex-router-sync']\r\n  },\r\n  output: {\r\n    path: config.build.assetsRoot,\r\n    publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,\r\n    filename: '[name].js'\r\n  },\r\n  resolve: {\r\n    extensions: ['', '.js', '.vue'],\r\n    fallback: [path.join(__dirname, '../node_modules')],\r\n    alias: {\r\n      'vue$': 'vue/dist/vue',\r\n      'src': path.resolve(__dirname, '../src'),\r\n      'assets': path.resolve(__dirname, '../src/assets'),\r\n      'less': path.resolve(__dirname, '../src/less'),\r\n      'router': path.resolve(__dirname, '../src/router'),\r\n      'components': path.resolve(__dirname, '../src/components'),\r\n      'pages': path.resolve(__dirname, '../src/pages'),\r\n      'muse-components': 'muse-ui/src'\r\n    }\r\n  },\r\n  resolveLoader: {\r\n    fallback: [path.join(__dirname, '../node_modules')]\r\n  },\r\n  module: {\r\n    preLoaders: [\r\n      {\r\n        test: /\\.vue$/,\r\n        loader: 'eslint',\r\n        include: projectRoot,\r\n        exclude: /node_modules/\r\n      },\r\n      {\r\n        test: /\\.js$/,\r\n        loader: 'eslint',\r\n        include: projectRoot,\r\n        exclude: /node_modules/\r\n      }\r\n    ],\r\n    loaders: [\r\n      {\r\n        test: /muse-ui.src.*?js$/,\r\n        loader: 'babel'\r\n      },\r\n      {\r\n        test: /\\.vue$/,\r\n        loader: 'vue'\r\n      },\r\n      {\r\n        test: /\\.js$/,\r\n        loader: 'babel',\r\n        include: projectRoot,\r\n        exclude: /node_modules/\r\n      },\r\n      {\r\n        test: /\\.less$/,\r\n        loader: 'style!css!less'\r\n      },\r\n      {\r\n        test: /\\.css$/,\r\n        loader: 'style!css'\r\n      },\r\n      {\r\n        test: /\\.json$/,\r\n        loader: 'json'\r\n      },\r\n      {\r\n        test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\r\n        loader: 'url',\r\n        query: {\r\n          limit: 10000,\r\n          name: utils.assetsPath('img/[name].[hash:7].[ext]')\r\n        }\r\n      },\r\n      {\r\n        test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\r\n        loader: 'url',\r\n        query: {\r\n          limit: 10000,\r\n          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')\r\n        }\r\n      }\r\n    ]\r\n  },\r\n  eslint: {\r\n    formatter: require('eslint-friendly-formatter')\r\n  },\r\n  vue: {\r\n    loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }),\r\n    postcss: [\r\n      require('autoprefixer')({\r\n        browsers: ['last 2 versions']\r\n      })\r\n    ]\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"bboywulong"}}