ls-webbuilder
Advanced tools
Can be used by projects to build a full standalone web application. Orders, concats, uglifies and transpiles the js or ts source and append some other assets like referenced html and css/less files
Weekly downloads
Readme
The LS-WebBuilder is a bundle tool that provides support of native import and export syntax in current web browsers down to IE 11.
Combines all js files and needed assets like html and css.
Converts less files automatically to css on build time
Transpiles the javascript code with babel
Support TypeScript
Minifies production code and generate sourceMaps
Caches built files to improve build time:
npm install -g ls-webbuilder
local installation is also possible
lsbuild
task-name
The lsbuild.json file defines the build configuration. It contains on root level an object with the following possible properties:
out
)["src"]
)["src/fileA.js", "src/fileB.js", "src/**"]
will load all files in src folder but at first fileA.js
then
fileB.js
constantModules: {"myConst": "function() {return window.screen.availHeight;}"}
import myConstant from 'myConst';
myConstant
is then a function which will return the availHeight of the screenprovidedNodeModules: ["express"]
import * as express
{"chrome": "49", "node": "10", "ie": "9"}
false
System.start()
is called.false
false
)false
)http://example.com/mySourcemap.map
inline
for inline sourcemaps and null
for relative path to the generated sourcemap maps/jsName.js.map
null
src/
so src/path/to/file
will result in path/to/file
true
)extensions: {"myExtension": "xml", "myPictureFormat": "base64"}
Default Extension behavior:
js
: .js
ts
: .ts
less
: .less
css
: .css
html
: .html
xml
: .xml
json
: .json
json5
: .json5
base64
: .png
, .jpg
/ .jpeg
, .gif
, .bmp
, .tiff
/ .tif
, .svg
(images are prefixed with data:image... stuff)text
: all other extensionssrc/FileA.js
export class A {
static method() {
// your code here
}
}
src/FileB.js
import {A} from './FileA.js';
export class B extends A {
static anotherMethod() {
// again your code
}
}
package.json
{
"name": "ExampleProject",
"version": "1.0.0",
"description": "My fancy project",
"scripts": {
"exampleTask": "lsbuild"
}
}
lsbuild.json
{
"extends": "./node_modules/my_config/lsbuild.json",
"clean": false,
"outputDir": "dist",
"outputFile": "bundle.js",
"addInitLib": true,
"autoStart": true,
"src": ["src"],
"modulePrefix": "src/",
"lessToCss": true,
"skipSourcemaps": false,
"sourcemapPath": "inline",
"providedNodeModules": ["express"],
"constantModules": {
"vue": "globalThis.Vue"
},
"aliases": {
"vue": "myVue", // allows import Vue from 'myVue'
"src/path/to/module": ["myModuleAlias", "src/my/fancy/module/alias"]
},
"extensions": {
".svg": "html" // to use html compression and use as string in code
},
"environment": {
"development": {
"targets": {
"chrome": "76"
}
},
"production": {
"targets": {
"ie": "11",
"edge": "17",
"chrome": "70",
"safari": "10",
"firefox": "68"
}
}
}
}
call possibilities
npm run exampleTask
lsbuild
lsbuild --prod
npx ls-webbuilder
index.html
<!DOCTYPE html>
<html>
<head>
<script src="dist/bundle.js"></script>
</head>
<body>
<!-- DO SOMETHING -->
</body>
</html>
useLegacyProperties
default value set to false"useLegacyProperties": false
lsbuild.json option to use non-loose class properties (allows typescript declare
usage to override property types)src
configurationimport myConst from 'myConst'
url(myPath)
expressions in .less
files to data-uri.svg
files are now imported as base64 data-uri by defaultoptional-chaining
and nullish-coalescing
--cache=path/to/cache
~
prefix for node_module imports @import '~myModule/test.less';
You need support or want to support my project? Please contact me: webbuilder@lseawalker.de
FAQs
Can be used by projects to build a full standalone web application. Orders, concats, uglifies and transpiles the js or ts source and append some other assets like referenced html and css/less files
The npm package ls-webbuilder receives a total of 413 weekly downloads. As such, ls-webbuilder popularity was classified as not popular.
We found that ls-webbuilder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.