- Parses Sprockets directives,
- Uses the same logical path file location resolution as Rails Sprockets.
- Reads your Gemfile.lock, enabling Gem usage, like jquery-ujs.
$ npm install sprockets-loader --save-dev
// Your webpack configurationmoduleexports =entry:'application.js': './examples/application.js'output:path: 'public/assets'filename: '[name]'module:preLoaders:loader: 'sprockets-loader'query:logicalPaths:'examples';
You can run tests with:
npm test or
npm run watch.
sprockets-loader can handle stylesheets, it is suggested that you do not use it for them.
If you insist on trying it, here's a small idea of how that would work:
// Your webpack configurationmoduleexports =entry:'application.css.js': './examples/application.css'// ...;
<!-- ... -->
This repository uses the term
compat to mean a base file type, such as
These compats can be found here.
There are three components to create a complete
extensions: Other file types that are compatible with the base file type.
loaders: Order-dependent loaders that are needed to interpret the base file compat, if encountered.
terminal: What the final file type should be, which can and in most cases will be different from the base file type.