
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
nordnet-release-plugin
Advanced tools
Nordnet release plugin - webpack plugin for building releases of Javascript applications
The purpose of this plugin is to simplify continuous integration with Javascript components in legacy websites.
By placing a single <script>
tag in legacy web it will automatically load latest version of the Javascript component after successful deployment, without requiring any change in the original script tag.
Install plugin as dev dependency
npm install nordnet-release-plugin --save-dev
Include plugin in webpack config
var NordnetReleasePlugin = require('nordnet-release-plugin');
plugins.push(new NordnetReleasePlugin({
publicPath: '/sc/project-name/cache/v1'
}));
See webpack docs for more information on how to use plugins with webpack.
Plugin generates base.js
file that should be included on the page via <script></script>
tag. Once loaded on the page base.js
will dynamically inject <script></script>
tags with links to all required entry points (according to webpack and nordnet-release-plugin settings).
For example, add <script>
tag on html page where you want to run your Javascript application
<script src="init/base.js"></script>
base.js
might have the following content (depending on your nordnet-release-plugin and webpack configuration)
document.write('<script charset="UTF-8" src="/sc/project-name/cache/v1/index.js"></script>');
Once base.js
is loaded it will inject <script>
tag on the page to load application entry point.
You can pass a hash of configuration options to nordnet-release-plugin
.
var NordnetReleasePlugin = require('nordnet-release-plugin');
plugins.push(new NordnetReleasePlugin({
initDir: './dist/init',
publicPath: '/sc/project-name/cache/v1',
ignoreChunks: [ 'async' ],
async: false,
}));
initDir:
Location where generated base.js should be saved. Defaults to './dist/init'
publicPath:
Path that should be used when creating links to entry points in base.js
(path where your application is deployed, e.g. '/sc/project-name/cache/v1'). Defaults to '/'
ignoreChunks:
Array with chunk names that should be ignored and excluded from base.json
. Defaults to empty array.
If your application has multiple entry points and for some reason you want to exclude some of them from being included in base.js
then pass entry point names (as configured in webpack) to ignoreChunks
array.
var entryPoints = {
index: [ './index.js' ],
admin: [ './admin.js' ],
};
plugins.push(new NordnetReleasePlugin({
ignoreChunks: [ 'admin' ],
}));
If you are using require.ensure()
to create split points and want to make sure that all of them don't end up in base.js
then consider using set up describe below.
Define a code split point using require.ensure
and provide a chunk name, see require.ensure for more details
function admin() {
require.ensure([], function(require) {
var admin = require('./admin');
admin();
}, 'admin');
}
Set up nordnet-release-plugin
to ignore async chunk when generating base.js
plugins.push(new NordnetReleasePlugin({
ignoreChunks: [ 'admin' ],
}));
async:
true | false
When set to true
then scripts will be dynamically injected on the page instead of using document.write
in base.json
. Defaults to false
.
MIT © Nordnet Bank AB
FAQs
Nordnet release plugin
The npm package nordnet-release-plugin receives a total of 0 weekly downloads. As such, nordnet-release-plugin popularity was classified as not popular.
We found that nordnet-release-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.