![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
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.
@ecl/builder
Advanced tools
By default, ecl-builder will read the ecl-builder.config.js
file at the root
of your project. You can use the -c
or --config
parameter if you want to
give your configuration file another name.
Typically, this is what it should look like:
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
module.exports = {
// Compile entry.js
scripts: [
{
entry: path.resolve(__dirname, 'src/entry.js'),
dest: path.resolve(__dirname, 'dist/output.js'),
options: {
sourceMap: isProd ? false : 'inline',
moduleName: 'myModule',
},
},
],
// Compile entry.scss
styles: [
{
entry: path.resolve(__dirname, 'src/entry.scss'),
dest: path.resolve(__dirname, 'dist/output.css'),
options: {
sourceMap: isProd ? 'file' : true,
minify: true,
},
},
],
// Copy files from src to dest
copy: [
{
from: path.resolve(__dirname, 'src/fonts'),
to: path.resolve(__dirname, 'dist/fonts'),
},
{
from: path.resolve(__dirname, 'src/images'),
to: path.resolve(__dirname, 'dist/images'),
},
],
};
ECL builder provides a thin wrapper on top of browsersync for facilitating development workflows with the assets mentioned above.
Example configuration:
{
init: {
proxy: `${app.host}:${app.port}`,
},
handlers: [
{
pattern: `./(dev|ec-core)/src/*.scss`,
events: [
{
on: 'change',
name: 'dev/ec-core presets scss changes',
command: 'npm run build:styles',
message: 'New styles ready',
reload: '*.css',
},
],
},
]
}
The object passed to init
is merged with the same method from browsersync. ECL uses the proxy
option for it's storybook instances, but this could be any other application such as a Drupal website.
handlers
define a list of event handlers spawning .watch()
tasks.
The value for on
property matches the chokidar's events.
reload
is the same as browsersync's reload()
. It's optional and could be most useful in handlers related to changes in styles (scss/css) which can be injected on the page without full page reload with reload("*.css")
. In all other cases, passing the function with empty parameters will cause a full page reload.
FAQs
Europa Component Library builder
The npm package @ecl/builder receives a total of 515 weekly downloads. As such, @ecl/builder popularity was classified as not popular.
We found that @ecl/builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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.