123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- const path = require("path");
- const HtmlWebpackPlugin = require("html-webpack-plugin");
- const UpdateVersionPlugin = require("./updateVersionPlugin");
- //const ChangeScriptSourcePlugin = require('./changeScriptSourcePlugin');
- const CopyPlugin = require("copy-webpack-plugin");
- const CleanWebpackPlugin = require("clean-webpack-plugin").CleanWebpackPlugin;
- module.exports = {
- entry: path.resolve(__dirname, "js/main.js"),
- output: {
- path: path.resolve(__dirname, "build", "js"),
- filename: "[name].[contenthash].js",
- library: "ivprogCore",
- libraryTarget: "umd",
- },
- node: {
- fs: "empty",
- },
- module: {
- rules: [
- {
- test: /\.js$/,
- exclude: /(node_modules)/,
- use: {
- loader: "babel-loader",
- options: {
- presets: ["@babel/preset-env"],
- },
- },
- },
- {
- test: /\.g4$/,
- exclude: /(node_modules)/,
- use: {
- loader: "antlr4-webpack-loader",
- },
- },
- {
- test: /\.tsx?$/,
- use: "ts-loader",
- exclude: /node_modules/,
- },
- {
- test: /\.csv$/,
- use: [
- {
- loader: path.resolve(__dirname, "i18n_csv_loader"),
- },
- ],
- exclude: /node_modules/,
- },
- ],
- },
- resolve: {
- extensions: [".tsx", ".ts", ".js", ".csv"],
- },
- stats: {
- colors: true,
- },
- plugins: [
- new CleanWebpackPlugin({
- cleanOnceBeforeBuildPatterns: [path.resolve(__dirname, "build/**/*")],
- watch: true,
- }),
- new UpdateVersionPlugin(),
- new HtmlWebpackPlugin({
- template: "templates/index.html",
- filename: path.resolve(__dirname, "build", "index.html"),
- }),
- new HtmlWebpackPlugin({
- template: "templates/runner.html",
- filename: path.resolve(__dirname, "build", "runner.html"),
- }),
- /*new ChangeScriptSourcePlugin(),*/
- new CopyPlugin([
- {
- from: "js/iassign-integration-functions.js",
- to: path.resolve(__dirname, "build/js"),
- },
- {
- from: "css/ivprog-visual-1.0.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {from: "css/ivprog-term.css", to: path.resolve(__dirname, "build/css")},
- {
- from: "css/ivprog-assessment.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {
- from: "css/ivprog-editor.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {from: "css/roboto.css", to: path.resolve(__dirname, "build/css")},
- {from: "css/fonts/", to: path.resolve(__dirname, "build/css/fonts")},
- {from: "js/Sortable.js", to: path.resolve(__dirname, "build/js")},
- {from: "js/jquery.min.js", to: path.resolve(__dirname, "build/js")},
- {from: "js/jquery-ui.min.js", to: path.resolve(__dirname, "build/js")},
- {from: "js/semantic.min.js", to: path.resolve(__dirname, "build/js")},
- {
- from: "css/semantic.min.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {from: "css/themes/", to: path.resolve(__dirname, "build/css/themes")},
- {from: "img/trash-icon.png", to: path.resolve(__dirname, "build/img")},
- {from: "img/empty.svg", to: path.resolve(__dirname, "build/img")},
- {from: "img/new_line.svg", to: path.resolve(__dirname, "build/img")},
- {from: "img/no_new_line.svg", to: path.resolve(__dirname, "build/img")},
- {
- from: "js/jquery.json-editor.min.js",
- to: path.resolve(__dirname, "build/js"),
- },
- {
- from: "node_modules/codemirror/lib/codemirror.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {
- from: "node_modules/codemirror/addon/hint/show-hint.css",
- to: path.resolve(__dirname, "build/css"),
- },
- {
- from: "node_modules/codemirror/theme/ttcn.css",
- to: path.resolve(__dirname, "build/css"),
- },
- /*{from:'index.html', to:path.resolve(__dirname, 'build')},
- {from:'runner.html', to:path.resolve(__dirname, 'build')},*/
- // Accessible UI
- {from: "css/accessible/bootstrap/bootstrap.css", to: path.resolve(__dirname, "build/css/accessible/bootstrap")},
- {from: "css/accessible/bootstrap/bootstrap-grid.css", to: path.resolve(__dirname, "build/css/accessible/bootstrap")},
- {from: "css/accessible/bootstrap/bootstrap-reboot.css", to: path.resolve(__dirname, "build/css/accessible/bootstrap")},
- {from: "css/accessible/design.css", to: path.resolve(__dirname, "build/css/accessible")},
- {from: "css/accessible/forms_var_comand.css", to: path.resolve(__dirname, "build/css/accessible")},
- {from: "css/accessible/style.css", to: path.resolve(__dirname, "build/css/accessible")},
- {from: "css/accessible/fontawesome/css/all.css", to: path.resolve(__dirname, "build/css/accessible/fontawesome/css")},
- {from: "css/accessible/fontawesome/webfonts/fa-brands-400.eot", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-brands-400.svg", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-brands-400.ttf", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-brands-400.woff", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-brands-400.woff2", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-regular-400.eot", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-regular-400.svg", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-regular-400.ttf", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-regular-400.woff", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-regular-400.woff2", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-solid-900.eot", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-solid-900.svg", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-solid-900.ttf", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-solid-900.woff", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "css/accessible/fontawesome/webfonts/fa-solid-900.woff2", to: path.resolve(__dirname, "build/css/accessible/fontawesome/webfonts")},
- {from: "js/accessibleUI/bootstrap/bootstrap.bundle.js", to: path.resolve(__dirname, "build/js/accessible/bootstrap"),},
- {from: "js/accessibleUI/bootstrap/bootstrap.js", to: path.resolve(__dirname, "build/js/accessible/bootstrap"),},
- ]),
- ],
- optimization: {
- splitChunks: {
- chunks: "all",
- },
- },
- devtool: "source-map",
- watchOptions: {
- ignored: [path.resolve(__dirname, ".ima_version.json")],
- }
- };
|