![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
grunt-preprocess
Advanced tools
Preprocess HTML and JavaScript directives based off environment configuration
Grunt task around preprocess npm module
<head>
<title>Your App
<!-- @if NODE_ENV='production' -->
<script src="some/production/lib/like/analytics.js"></script>
<!-- @endif -->
</head>
<body>
<!-- @ifdef DEBUG -->
<h1>Debugging mode - <!-- @echo RELEASE_TAG --> </h1>
<!-- @endif -->
<p>
<!-- @include welcome_message.txt -->
</p>
</body>
var configValue = '/* @echo FOO */' || 'default value';
// @ifdef DEBUG
someDebuggingCall()
// @endif
See preprocess documentation for more information
Install this grunt plugin next to your project's Gruntfile with: npm install --save-dev grunt-preprocess
Then add this line to your project's Gruntfile:
grunt.loadNpmTasks('grunt-preprocess');
Type: Boolean
Default: `undefined
Required to enable overwriting of source files
Type: Object
Default: {}
The additional context on top of ENV that should be passed to templates
preprocess : {
options: {
context : {
DEBUG: true
}
},
html : {
src : 'test/test.html',
dest : 'test/test.processed.html'
},
multifile : {
files : {
'test/test.processed.html' : 'test/test.html',
'test/test.processed.js' : 'test/test.js'
}
},
inline : {
src : [ 'processed/**/*.js' ],
options: {
inline : true,
context : {
DEBUG: false
}
}
},
js : {
src : 'test/test.js',
dest : 'test/test.processed.js'
}
}
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
context
optionCopyright OneHealth Solutions, Inc
Written by Jarrod Overson
Licensed under the Apache 2.0 license.
FAQs
Preprocess HTML and JavaScript directives based off environment configuration
We found that grunt-preprocess demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.