Adds a build option to directly compile the plugin into the runtime, so ant deploy is not needed for testing changes.

git-svn-id: https://svn.libreccm.org/ccm/trunk@5766 8810af33-2d31-482b-a856-94f89814c4df
master
baka 2018-12-04 10:04:46 +00:00
parent 02ec9e0023
commit a8889c03b0
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,35 @@
const path = require("path");
const webpack = require("webpack");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const pluginName = "ccm-cms-images";
module.exports = {
entry: {
plugin: "./src/index.ts",
"plugin.min": "./src/index.ts"
},
output: {
path: path.join(__dirname, "../../../../../runtime/apache-tomcat-8.5.15/webapps/ROOT/assets/tinymce/js/tinymce/plugins", pluginName),
filename: "[name].js"
},
resolve: {
extensions: [".webpack.js", ".web.js", ".ts", ".js"]
},
module: {
rules: [{
test: /\.ts$/,
use: "ts-loader"
}]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
}),
new CopyWebpackPlugin([{
from: path.join(__dirname, "../src/LICENSE"),
to: path.join(__dirname, "../dist", pluginName)
}])
]
};

View File

@ -11,6 +11,7 @@
"start": "webpack-dev-server --config config/webpack.config.dev.js --progress --open --inline",
"lint": "tslint 'src/**/*.js'",
"build": "webpack --config config/webpack.config.prod.js --progress",
"test": "webpack --config config/webpack.config.test.js --progress",
"watch": "npm-watch"
},
"author": "",