Last active
May 2, 2018 03:06
-
-
Save ravasthi/abcfee465411fc45a8bc28decb9d8e5e to your computer and use it in GitHub Desktop.
eslint-plugin-import issue 238 configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "babel-eslint", | |
"extends": "airbnb", | |
"plugins": [ | |
"babel", | |
"import", | |
"react" | |
], | |
"rules": { | |
"indent": ["error", 4], | |
"sort-imports": ["error", { | |
"ignoreCase": true | |
}], | |
"no-underscore-dangle": ["error", { | |
"allowAfterThis": true | |
}] | |
}, | |
"settings" : { | |
"import/resolver": { | |
"webpack": { | |
"config": "webpack.config.js" | |
} | |
} | |
}, | |
"env": { | |
"mocha": true, | |
"jquery": true | |
}, | |
"globals": { | |
"chai": true, | |
"sinon": true | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* abbreviated */ | |
{ | |
"engines": { | |
"node": ">= 5.11.0" | |
}, | |
"main": "index.js", | |
"scripts": { | |
"test": "gulp test" | |
}, | |
"dependencies": { | |
"babel-core": "~6.7.7", | |
"babel-eslint": "~6.0.4", | |
"babel-loader": "~6.2.4", | |
"babel-polyfill": "~6.7.4", | |
"babel-preset-airbnb": "^1.1.1", | |
"babel-preset-es2015": "~6.6.0", | |
"babel-preset-react": "~6.5.0", | |
"babel-preset-stage-0": "~6.5.0", | |
"babel-register": "~6.7.2", | |
"babel-relay-plugin": "~0.8.1", | |
"babel-relay-plugin-loader": "~0.8.0", | |
"eslint": "~2.9.0", | |
"eslint-config-airbnb": "~8.0.0", | |
"eslint-import-resolver-webpack": "~0.2.4", | |
"eslint-plugin-babel": "~3.2.0", | |
"eslint-plugin-import": "~1.6.1", | |
"eslint-plugin-jsx-a11y": "~1.0.4", | |
"eslint-plugin-react": "~5.0.1", | |
"estraverse": "~4.2.0", | |
"estraverse-fb": "~1.3.1", | |
"karma": "=0.13.18", | |
"karma-babel-preprocessor": "~6.0.1", | |
"karma-sourcemap-loader": "~0.3.7", | |
"karma-webpack": "~1.7.0", | |
"webpack": "~1.13.0", | |
"webpack-stream": "~3.2.0", | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import webpack from 'webpack'; | |
const webpackConfig = { | |
entry: { | |
app: path.resolve(__dirname, 'public', 'app.js'), | |
'app-header': path.resolve(__dirname, 'public', 'app-header.js'), | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /(node_modules|bower_components)/, | |
loader: 'babel', | |
}, | |
{ | |
test: /\.svg$/, | |
include: [ | |
path.resolve(__dirname, 'public', 'images'), | |
], | |
exclude: /(node_modules|bower_components)/, | |
loader: 'svg-inline', | |
}, | |
], | |
}, | |
output: { | |
filename: '[name].js', | |
path: path.resolve(__dirname, '.build'), | |
}, | |
plugins: [ | |
new webpack.ResolverPlugin( | |
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin( | |
'bower.json', ['main'] | |
) | |
), | |
new webpack.ProvidePlugin({ | |
$: 'jquery', | |
jQuery: 'jquery', | |
'window.$': 'jquery', | |
'window.jQuery': 'jquery', | |
}), | |
], | |
resolve: { | |
root: [ | |
path.resolve(__dirname), | |
], | |
alias: { | |
charts: 'public/charts', | |
components: 'public/components', | |
jquery: 'jquery/dist/jquery.slim', | |
uikit: 'uikit/js/uikit', | |
}, | |
modulesDirectories: [ | |
'bower_components', | |
'node_modules', | |
'web_modules', | |
], | |
}, | |
}; | |
export { webpackConfig }; |
Okay, explicitly doing a module.exports = webpackConfig
fixes this issue for me. Thanks for looking into it!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, yeah: the config needs to be the module.exports.