$ yarn serve
$ yarn build
Make sure to update
$VERSION
in package.json. RECOVER old versions before commit.
$ yarn sync
You need to first configure
aws
cli.
The application will be released to "https://atlassian.zenuml.com/v1.0.9/edit.html".
-
Both 'view.html' and 'edit.html' will share the same JS file.
Pros:
- It simplifies the building system. By default,
vue-cli-service serve
treats onlymain.js
as the entry. Though we can change it by providing anentry
parameter, it means we need to assign differententry
JS files to different html files. - It allows us to include the current code in the viewing page. This can be useful for users to quick view the code. This is NOT a feature we are going to support soon.
Cons:
- It means we are including editor's JS into the bundle. It
would increase the size by a large extent. This makes
view.html
andedit.html
almost the same.
There is another factor to be considered - the template compiler. We could include the template compiler, and use different template in
view.html
andedit.html
. This also has its own pros and cons.Pros:
- It is a clearer separation of intentions, as the difference of viewing and editing is located in the html files. It is at the end of the day why we have two html files.
Cons:
- It increases the JS file by about 25Kb (10Kb zipped) for both viewing and editing.
- It simplifies the building system. By default,
These two files are used to insert or update the sequence diagram.
These two files are used to render the diagram in the confluence page.
-
There is not webpack config, how to configure the output?
By default the,
vue-cli-service
create a Zero-config project structure. Webpack's configure can be added to vue.config.js.module.exports = { configureWebpack: config => { // ... } };
-
How is the
index.html
generated?The
index.html
is generated by thehtml-webpack-plugin
. This is configured in./node_modules/@vue/cli-service/lib/config/app.js
. The template is (by convention) in the./public
folder. -
How to generate multiple html files?
To generate more than one html files, declare the plugin more than once. In
vue.config.js
:// Basic configuration var HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { configureWebpack: { plugins: [ new HtmlWebpackPlugin({ filename: 'app.html', template: './public/app-template.html', inject: true }) ] }};
Or
// Chaining chainWebpack: config => { config .plugin('app-html') .use(HtmlWebpackPlugin, [{ filename: 'app.html', template: './public/app-template.html', inject: true }])
With the above configuration,
app.html
will be generated indist
folder. However, you will see thatapp-template.html
is also copied into that folder. To prevent that from happening, we need to modify the options of thecopy
plugin.First, run
vue inspect > inspect.js
to check what is the current configuration of thecopy
plugin./* config.plugin('copy') */ new CopyWebpackPlugin( [ { from: '/the/aboslute/path/confluence-plugin/public', to: '/the/aboslute/path/confluence-plugin/dist', ignore: [ 'index.html', '.DS_Store' ] } ] ),
Now, let's update the configure with chaining API.
config .plugin('copy') // get the plugin if it exists .tap(args => { // constructor parameter for 'CopyWebpackPlugin' args[0][0].ignore.push('app-template.html') return args })