Build translations with webpack
Convert the `po2json` script into a webpack plugin, and integrate the (now trivial) po.empty.js template. This is the last step for building the entire dist/ directory with `npm run build` (i.e. a tool that web developers are familiar with), and not having a split webpack+make toolchain any more.
This commit is contained in:
parent
07017f79d8
commit
7f6ef51c12
5 changed files with 81 additions and 137 deletions
|
|
@ -1,11 +1,14 @@
|
|||
const path = require("path");
|
||||
const childProcess = require('child_process');
|
||||
|
||||
const copy = require("copy-webpack-plugin");
|
||||
const extract = require("mini-css-extract-plugin");
|
||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||
const webpack = require("webpack");
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
const CockpitPoPlugin = require("./src/lib/cockpit-po-plugin");
|
||||
|
||||
const webpack = require("webpack");
|
||||
|
||||
const nodedir = path.resolve((process.env.SRCDIR || __dirname), "node_modules");
|
||||
|
||||
|
|
@ -20,7 +23,8 @@ const copy_files = [
|
|||
|
||||
const plugins = [
|
||||
new copy({ patterns: copy_files }),
|
||||
new extract({filename: "[name].css"})
|
||||
new extract({filename: "[name].css"}),
|
||||
new CockpitPoPlugin(),
|
||||
];
|
||||
|
||||
/* Only minimize when in production mode */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue