fabe06e339
This feature was originally authored by @sweetppro in PR #438. However, since the PR ended up in an unclean state with multiple master merges (instead of rebase) from the upstream, there are several commits that are out of order and can can no longer be be squashed for a clean feature merge. This commit aggregates the changes from the original PR and applies the following fixes on top of it. - Add custom admin JS box to appearance UI. - Refactor i18n language strings. - Add handlers and migrations for the new `appearance.admin.custom_js` field. - Fix migration version to `v2.1.0` - Load custom appearance CSS/JS bytes into global constants during boot instead of making a DB call on every request. - Fix and canonicalize URIs from `/api/custom*` to `/public/*.css` and `/admin/*.css`. Add proxy paths to yarn proxy config. - Remove redundant HTTP handlers for different custom appearance files and refactor into a single handler `serveCustomApperance()` - Fix content-type and UTF8 encoding headers for different file types. - Fix incorrect registration of public facing custom CSS/JS handlers in the authenticated admin URI group. - Fix merge conflicts in `Settings.vue`. - Minor HTML and style fixes. - Remove the `AppearanceEditor` component and use the existing `HTMLEditor` component instead. - Add `language` prop to the `HTMLEditor` component. Co-authored-by: SweetPPro <sweetppro@users.noreply.github.com>
40 lines
1.2 KiB
JavaScript
Vendored
40 lines
1.2 KiB
JavaScript
Vendored
module.exports = {
|
|
publicPath: '/admin',
|
|
outputDir: 'dist',
|
|
|
|
// This is to make all static file requests generated by Vue to go to
|
|
// /frontend/*. However, this also ends up creating a `dist/frontend`
|
|
// directory and moves all the static files in it. The physical directory
|
|
// and the URI for assets are tightly coupled. This is handled in the Go app
|
|
// by using stuffbin aliases.
|
|
assetsDir: 'static',
|
|
|
|
// Move the index.html file from dist/index.html to dist/frontend/index.html
|
|
// indexPath: './frontend/index.html',
|
|
|
|
productionSourceMap: false,
|
|
filenameHashing: true,
|
|
|
|
css: {
|
|
loaderOptions: {
|
|
sass: {
|
|
implementation: require('sass'), // This line must in sass option
|
|
},
|
|
},
|
|
},
|
|
|
|
devServer: {
|
|
port: process.env.LISTMONK_FRONTEND_PORT || 8080,
|
|
proxy: {
|
|
'^/$': {
|
|
target: process.env.LISTMONK_API_URL || 'http://127.0.0.1:9000'
|
|
},
|
|
'^/(api|webhooks|subscription|public|health)': {
|
|
target: process.env.LISTMONK_API_URL || 'http://127.0.0.1:9000'
|
|
},
|
|
'^/(admin\/custom\.(css|js))': {
|
|
target: process.env.LISTMONK_API_URL || 'http://127.0.0.1:9000'
|
|
}
|
|
}
|
|
}
|
|
};
|