ui-code-loader v1.4.0
UI CODE LOADER
[中文]

Install
npm install ui-code-loader --save-devGetting started
- Add
ui-code-loaderto your webpack development config
// webpack.dev.config.js
module: {
rules: [
{
test: /\.(vue|html)$/,
use: [
{
loader: 'ui-code-loader'
}
],
enforce: 'pre',
exclude: [path.resolve(__dirname, '../../node_modules')] // better exlude node_modules
}
]
}Note: You can choose either .vue or .html on demand. You'd better use this loader for development config. If eslint-loader with enforce:'pre' is also used, this loader should be put ahead of it.
- Run your project loacally.
Alt + clickany ui component resolved by ui-code-loader on your browser, the magic just happen.
Config
idePaths: theabsolute IDE pathorder you want. The order is [...idePaths, '/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin/code', '/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'].isSendReqest: send request to open IDE or not. Default isTrue.cb: callback in case you want to do sth else. The param isthe absolute pathof choiced component file.
与cache-loader共同使用,需要通过暴露的createServer api手动运行loader,
require('ui-code-loader').createServer(),防止vue构建全部被缓存ui-code-loader没有被运行when use
cache-loader, you should call the createServer api,require('ui-code-loader').createServer(), to avoid server not be started
Example
npm i && npm run dev