All Projects β†’ MaxPleaner β†’ slim-lang-loader

MaxPleaner / slim-lang-loader

Licence: MIT License
Webpack loader: slim => html => javascript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to slim-lang-loader

angular-hmr-loader
πŸ”₯ Angular HMR Webpack Loader by @AngularClass
Stars: ✭ 32 (+60%)
Mutual labels:  webpack-loader
color-loader
🎨 A webpack loader that extracts the color palette of an image
Stars: ✭ 14 (-30%)
Mutual labels:  webpack-loader
React-bookstore
Bookstore using google-book Apis made with reactjsπŸ”₯πŸš€
Stars: ✭ 14 (-30%)
Mutual labels:  webpack-loader
webpack-webmanifest-loader
Minimalistic webpack loader to generate webmanifest file (and process icons URLs).
Stars: ✭ 16 (-20%)
Mutual labels:  webpack-loader
svelte-loader-hot
Webpack loader for svelte components with HMR support
Stars: ✭ 22 (+10%)
Mutual labels:  webpack-loader
preprocessor-loader
Bring the awesome "Conditional Compilation" to the Webpack, and more.
Stars: ✭ 32 (+60%)
Mutual labels:  webpack-loader
fengari-loader
Webpack loader for fengari
Stars: ✭ 27 (+35%)
Mutual labels:  webpack-loader
standard-loader
webpack loader for linting your code with https://github.com/feross/standard
Stars: ✭ 66 (+230%)
Mutual labels:  webpack-loader
markup-inline-loader
a webpack loader to embed svg/MathML to html
Stars: ✭ 24 (+20%)
Mutual labels:  webpack-loader
nunjucks-loader
Webpack loader for Nunjucks templates
Stars: ✭ 20 (+0%)
Mutual labels:  webpack-loader
react-spa-template
This is a sample template for single page applications built using React + Router to work with webpack dev server
Stars: ✭ 19 (-5%)
Mutual labels:  webpack-loader
angular-translate-loader
"angular-translate" loader for webpack
Stars: ✭ 15 (-25%)
Mutual labels:  webpack-loader
graphql-raw-loader
πŸ– With Webpack, loads GraphQL files as raw strings and handle it's import directive & comment statement.
Stars: ✭ 19 (-5%)
Mutual labels:  webpack-loader
lodash-loader
Cherry-picks Lodash functions and require them explicitly to reduce the webpack bundle size.
Stars: ✭ 13 (-35%)
Mutual labels:  webpack-loader
vue-template-compiler-loader
Webpack loader to pre-compile Vue 2.0 templates
Stars: ✭ 26 (+30%)
Mutual labels:  webpack-loader
css-raw-loader
🌁 CSS Raw loader module for Webpack
Stars: ✭ 13 (-35%)
Mutual labels:  webpack-loader
webpack-modernizr-loader
Get your modernizr build bundled with webpack, use modernizr with webpack easily
Stars: ✭ 35 (+75%)
Mutual labels:  webpack-loader
yaml-frontmatter-loader
[DEPRECATED] Yaml frontmatter loader
Stars: ✭ 12 (-40%)
Mutual labels:  webpack-loader
mjml-loader
MJML loader for webpack
Stars: ✭ 27 (+35%)
Mutual labels:  webpack-loader
graphql-loader
πŸ’ A webpack loader for .graphql documents
Stars: ✭ 60 (+200%)
Mutual labels:  webpack-loader

slim-lang-loader

This is a webpack loader to transform slim files into HTML, and then load that HTML into Javascript. This is "true blue" slim, using the ruby program's CLI executable.

The resulting HTML does not have any boiler added - it can be full HTML documents or just partials / fragments.

The code here is a modified version of coffee-loader.

howto

  1. Make sure the slim gem is installed and there is a slimrb executable available.

  2. Install this into your project: npm install --save slim-lang-loader (or yarn add -D slim-lang-loader)

  3. Add hook to webpack.config.js (make sure to put this above any loader that expects javascript or coffeescript input):

    {test: /\.slim$/, loader: ['slim-lang-loader']},

    Also, add .slim to the list of extensions:

    resolve: {
      extensions: ['.js", <etc>, ".slim"]
    },
  4. load templates from javascript:

     var file = require("html-loader!./test.slim");
     alert(file); // this will be a html string that auto-reloads 

slim options

You can pass Slim options to slimrb using following syntax:

loader: [
  {
    loader: 'slim-lang-loader',
    options: {
      slimOptions: {
        'disable_escape': true
      }
    }
  }
]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].