Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carbon LDP JavaScript ES2015 Boilerplate

Boilerplate that shows how to setup Carbon LDP SDK in a JavaScript ES2015 application.

This boilerplate uses Webpack as a module loader which also bundles the code and serves the app. Other setups could use other module loaders like requirejs, browserify or no module loader at all (although that would mean no support for import statements).

Setup

Install dependencies

  1. Install node.js (we recommend installing the "Current" version)

  2. cd into the project's folder:

    cd ~/your/path/carbonldp-js-es2015-boilerplate/
  3. Install the project's dependencies by running the following command:

    npm install
  4. Run the application with the following command:

    npm start

This will run a webpack-dev-server instance that will serve the project's files.

And that's it, you're ready to use the Carbon SDK.

NPM Scripts

package.json defines the following tasks:

  • build: Generates the final distribution version
  • clean:dist: Cleans dist directory
  • start: Runs server:dev
  • server:dev: Runs Webpack bundler in dev mode and starts the app

Generating the production version

To generate the production version, just run this command:

npm run build

It will generate the dist folder with the production-ready files.

File structure

.
├── config                              # Source code of the application
│   ├── webpack.common.js               # Settings shared to create the dev/prod bundles
│   ├── webpack.config.js               # Settings to create the dev bundle
│   ├── webpack.helpers.js              # Helpers used in webpack config files
│   └── webpack.prod.js                 # Settings to create the prod bundle
├── dist                                # Distribution ready files
├── node_modules                        # npm dependencies (don't touch them)
├── src                                 # Source code of the application
│   ├── app.js                          # Application main script file importing Carbon
│   ├── index.html                      # Entry point for the app
│   └── polyfills.js                    # File importing the required polyfills to work on old browsers
├── .gitignore                          # Configuration file telling git what files to ignore
├── CHANGELOG                           # File to track package changes
├── favicon.ico                         # Small icon to display on browsers when visitng the app
├── package.json                        # npm configuration file listing the project's packages
├── package-lock.json                   # Describes the exact tree generated by installing packages
└── README.md                           # this

TODO

  • Implement a testing suite

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages