Skip to content

Commit da566a6

Browse files
feat: add webpack resolver (#231)
1 parent 8e9c183 commit da566a6

18 files changed

+433
-1138
lines changed

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ module.exports = (api) => {
1616
],
1717
],
1818
};
19-
};
19+
};

bench/fixtures/imports/webpack.config.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
// Just run "webpack-dev-server"
22
function plugin() {
3-
return function(style) {
4-
style.define('add', function(a, b) {
3+
return (style) => {
4+
style.define('add', (a, b) => {
55
return a.operate('+', b);
66
});
77
};
88
}
99

1010
module.exports = {
1111
context: __dirname,
12-
entry: "./index.js",
12+
entry: './index.js',
1313
output: {
14-
path: __dirname + '/tmp',
14+
path: `${__dirname}/tmp`,
1515
filename: 'bundle.js',
1616
},
1717
resolve: {
18-
extensions: ["", ".js", ".css", ".styl"]
18+
extensions: ['', '.js', '.css', '.styl'],
1919
},
2020
module: {
2121
loaders: [
2222
{
2323
test: /\.styl$/,
24-
loader: 'style-loader!css-loader!' + require('path').join(__dirname, '../../../index'),
24+
loader: `style-loader!css-loader!${require('path').join(
25+
__dirname,
26+
'../../../index'
27+
)}`,
2528
},
26-
]
29+
],
2730
},
2831
stylus: {
2932
use: [plugin()],

index.js

-221
This file was deleted.

package-lock.json

+48-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"webpack": "^4.0.0 || ^5.0.0"
4343
},
4444
"dependencies": {
45-
"loader-utils": "^1.0.2",
45+
"loader-utils": "^2.0.0",
4646
"lodash.clonedeep": "^4.5.0",
4747
"schema-utils": "^2.7.1",
4848
"when": "~3.6.x"

0 commit comments

Comments
 (0)