This plugin allows you to extract nashorn modules to your node_modules work directory and on compilation success package your application as a runnable jar.
This plugin expects that your already have Apache Maven installed in your system since will interact with it in order to perform its tasks.
npm install --save-dev webpack-vertx-plugin
In webpack.config.js
:
const WebpackVertxPlugin = require('webpack-vertx-plugin');
module.exports = {
...
...
plugins: [
new WebpackVertxPlugin({extractOnly: false})
],
...
}
Insert into your webpack.config.js:
const WebpackVertxPlugin = require('webpack-vertx-plugin');
const path = require('path');
var plugins = [];
plugins.push(new WebpackVertxPlugin());
var config = {
entry: {
app: path.resolve(__dirname, 'src/app.js')
},
output: {
path: path.resolve(__dirname, 'dist'), // regular webpack
filename: 'bundle.js'
},
devServer: {
contentBase: path.resolve(__dirname, 'src') // dev server
},
plugins: plugins,
module: {
loaders: [
{test: /\.js$/, loaders: 'babel'},
{test: /\.scss$/, loader: 'style!css!scss?'},
{test: /\.html$/, loader: 'html-loader'}
]
}
}
module.exports = config;
extractOnly
: boolean to only extract resources tonode_modules
(do not executemvn package
in the end of the build). Default: falseverbose
: boolean to display the maven output. Default: falsewatchPattern
: a ant pattern to pass to vertx when watching for file changes, Default: src/main/resources/**/*verticle
: the name of the main verticle.