README
ed-lansawebpack-plugin
Resolve LANSA repository field, mtxtvars and messages definitions and create a repository object to use in Vue projects.
Installation
- Add ed-lansawebpack-plugin to your project
$ npm install --save-dev ed-lansawebpack-plugin
- Add the plugin in
vue.config.js
const LansaWebPackPlugin = require('ed-lansawebpack-plugin')
module.exports = {
chainWebpack: config => {
config.module
.rule('vue-repo')
.test(/\.vue$/)
.exclude
.add(/node_modules/)
.end()
.use('ed-lansawebpack-plugin')
.loader('ed-lansawebpack-plugin')
.end();
config.module
.rule('js-repo')
.test(/\.js$/)
.exclude
.add(/node_modules/)
.end()
.use('ed-lansawebpack-plugin')
.loader('ed-lansawebpack-plugin')
.end();
config
.plugin('LansaWebPackPlugin.compiler')
.use(LansaWebPackPlugin.compiler, [{
devserver: {
host: 'localhost',
port: '8000',
path: '/lansa/getrepository'
}}])
.end();
}
- Add repository reference in
main.js
import repository from '../lansa/repository';
Warning! the code MUST be inserted immediatly after
import app from './app.vue';
Usage
In .vue or .js sources the plugin will search for theese tags references:
v-ed-formatdirectivep-lansa-fieldattribute$lansa.textfunction__LANSA__template function (use when needs to decode LANSA repository objects in other parts of the program)
function __LANSA__(t) {return t;}
License
ed-lansawebpack-plugin may be redistributed according to the BSD 3-Clause License.
Copyright 2020