Skip to content

Commit

Permalink
Add resolve support for .js and .jsx files
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelro committed May 31, 2017
1 parent 9651493 commit e324daf
Show file tree
Hide file tree
Showing 12 changed files with 981 additions and 9,520 deletions.
1 change: 1 addition & 0 deletions .nyc_output/cc97682b5324df9651ac8f8581bce375.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require( './module.js' );
require( './plugins.js' );
require( './devtool.js' );
require( './externals.js' );
require( './resolve.js' );

const { webpack } = require('./config');

Expand Down
3 changes: 0 additions & 3 deletions config/webpack/mappable.js

This file was deleted.

9 changes: 9 additions & 0 deletions config/webpack/resolve.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { webpack } = require('./config');

webpack.setProp('resolve', function () {
this.config.resolve = {
extensions: ['.js', '.jsx']
}
});

module.exports = { webpack };
19 changes: 19 additions & 0 deletions config/webpack/tests/resolve.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const assert = require('chai').assert;
const _resolve = require('../resolve');
const { webpack } = require('../config');

describe( 'resolve', function() {
describe( 'props', function ( ) {
it( 'should define a resolve property', function () {
assert.property( webpack.config, 'resolve' );
} );

it( 'should be of type object', function () {
assert.isObject( webpack.config.resolve );
} );

it( 'should contain a extensions array', function () {
assert.isArray( webpack.config.resolve.extensions );
} );
} );
} );
18 changes: 9 additions & 9 deletions dist/css/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/images/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e324daf

Please sign in to comment.