Skip to content

Commit 9963a0e

Browse files
committed
Updated README with usage instructions.
1 parent 3836a56 commit 9963a0e

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,29 @@ Laravel Localization loader for webpack. Convert Laravel Translation strings to
77
```shell
88
npm install laravel-localization-loader
99
```
10+
11+
### Usage
12+
13+
#### Webpack 2
14+
15+
```js
16+
// webpack.config.js
17+
module.exports = {
18+
// ...
19+
module: {
20+
rules: [
21+
{
22+
// Matches all PHP files in `resources/lang` directory.
23+
test: /resources\/lang.+\.php$/,
24+
loader: 'laravel-localization-loader',
25+
}
26+
]
27+
},
28+
// ...
29+
}
30+
```
31+
## Test
32+
33+
```shell
34+
npm run test
35+
```

tests/loader.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('should load PHP Laravel translation file', () => {
1414
})
1515
})
1616

17-
function runWebpack(config, legacy) {
17+
function runWebpack(config) {
1818
return new Promise((resolve, reject) => {
1919
const webpackConfig = merge({
2020
output: {
@@ -27,7 +27,6 @@ function runWebpack(config, legacy) {
2727
{
2828
test: /resources\/lang.+\.php$/,
2929
loader: 'laravel-localization-loader',
30-
options: { legacy },
3130
}
3231
]
3332
},

0 commit comments

Comments
 (0)