strict-loader
Version:
Adds `use strict;` in the beginning of each source
55 lines (38 loc) • 1.31 kB
Markdown
# strict-loader
[](https://www.npmjs.com/package/strict-loader)
[](https://www.npmjs.com/package/strict-loader)
[](https://travis-ci.org/mistadikay/strict-loader)
[](https://david-dm.org/mistadikay/strict-loader)
> Adds `use strict;` in the beginning of each source
:heavy_check_mark: Webpack 2 compatible
Please note that if you use Babel, the strict transformer [automatically places](https://babeljs.io/docs/plugins/transform-strict-mode/) a "use strict"; directive at the top of your files. In this case you don't need strict-loader.
## Install
```
$ npm install --save strict-loader
```
## Usage
### inline
``` javascript
require('strict!./yourmom.js');
```
### webpack config
``` javascript
module.exports = {
module: {
loaders: [
{
test: /\.js$/,
loader: 'strict'
}
]
}
};
```
### demo
```
npm install
npm start
```
Open `http://localhost:8080/` in browser — you should see text `strict-loader is working`
## License
MIT