dom-open-sourcecode
Dom-Open-Sourcecode
A handy tool that helps developers quickly find source code from the DOM and evoke the IDE
Usage
Untill now (< 1.0.0), this tool only supports Vue, and plans to support React after version 1.0.0
Install
npm install dom-open-sourcecode -D
Vue
Only need to config in vue.config.js
/**
* @DOSVue : constructor
* @DOSVueInsertScriptPlugin : Webpack Plugin
*/
const {
DOSVue,
DOSVueInsertScriptPlugin,
} = require("dom-open-sourcecode");
const DOSVueConfig: {
// The port of your devServer you have launched
port: string;
// The attribute key you would like to attached on DOM element which use 'data-source-code-location' as default
domAttribute?: string;
// The url path you would like to use for this function which use '/code' as default
urlPath?: string;
} = {
port: "8080",
};
// Step1 : new DOSVue instance
const dosVue = new DOSVue(DOSVueConfig);
module.exports = {
devServer: {
port: 8080,
// Step2 : Insert dosVue.serverConfig,
...dosVue.serverConfig,
// ......
},
chainWebpack: (config) => {
/**
* Although this loader will not break your logic code or do any things which have some sideeffects
* The only thing this loader do this to attched one customized attribute on some DOM elements
* But I still recommend turning it on only when developing locally
*/
// Step3 : config dosVue loader
config.module.rule("vue").use(dosVue.loader).loader(dosVue.loader).end();
// ......
},
// ......
configureWebpack: {
// Step4 : config DOS plugin
plugins: [new DOSVueInsertScriptPlugin(DOSVueConfig)],
// ......
},
};
Related Packages
duplicate-dependencies-webpack-plugin
webpack plugin to find duplicated dependencies from your bundle
332,104
6
@chiballc/utils
TypeScript utilities, browser worker messaging, and the Kibao Nuxt module for Op...
10,723
0
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.4.0 | >=2 <3 | MIT | |
| 1.3.5 | >=2 <3 | MIT | |
| 1.3.4 | >=2 <3 | MIT | |
| 1.3.3 | >=2 <3 | MIT | |
| 1.3.2 | >=2 <3 | MIT | |
| 1.3.1 | >=2 <3 | MIT | |
| 1.3.0 | >=2 <3 | MIT | |
| 1.2.0 | >=2 <3 | MIT | |
| 0.21.0 | >=2 <3 | MIT | |
| 0.6.1 | >=2 <3 | MIT | |
| 0.6.0 | >=2 <3 | MIT | |
| 0.5.0 | >=2 <3 | MIT | |
| 0.4.0 | >=2 <3 | MIT | |
| 0.3.0 | >=2 <3 | MIT | |
| 0.2.0 | >=2 <3 | MIT | |
| 0.1.36 | >=2 <3 | MIT | |
| 0.1.35 | >=2 <3 | MIT | |
| 0.1.34 | >=2 <3 | MIT | |
| 0.1.33 | >=2 <3 | MIT | |
| 0.1.32 | >=2 <3 | MIT | |
| 0.1.31 | >=2 <3 | MIT | |
| 0.1.30 | >=2 <3 | MIT | |
| 0.1.29 | >=2 <3 | MIT | |
| 0.1.28 | >=2 <3 | MIT | |
| 0.1.27 | >=2 <3 | MIT | |
| 0.1.26 | >=2 <3 | MIT | |
| 0.1.25 | >=2 <3 | MIT | |
| 0.1.24 | >=2 <3 | MIT | |
| 0.1.23 | >=2 <3 | MIT | |
| 0.1.22 | >=2 <3 | MIT |
Showing the latest 30 of 53. See every release on npm
Pre-releases (15)
| Version | Released | Vue | License |
|---|---|---|---|
| 0.21.0-0 | >=2 <3 | MIT | |
| 0.20.0-0 | >=2 <3 | MIT | |
| 0.19.0-0 | >=2 <3 | MIT | |
| 0.18.0-0 | >=2 <3 | MIT | |
| 0.17.0-0 | >=2 <3 | MIT | |
| 0.16.0-0 | >=2 <3 | MIT | |
| 0.13.0-0 | >=2 <3 | MIT | |
| 0.12.0-0 | >=2 <3 | MIT | |
| 0.11.0-0 | >=2 <3 | MIT | |
| 0.10.0-0 | >=2 <3 | MIT | |
| 0.9.0-0 | >=2 <3 | MIT | |
| 0.8.0-0 | >=2 <3 | MIT | |
| 0.7.2-bata | >=2 <3 | MIT | |
| 0.7.1-bata | >=2 <3 | MIT | |
| 0.7.0-bata | >=2 <3 | MIT |