I use Uikit in react project it success to import .less with resolve:{...}
but issue on import uikit.js and I change to imports-loadaer
is It was the same
in webpack.config.js file
...
...
,
resolve: {
root: [
path.join(__dirname, 'theme/js'),
path.join(__dirname, 'theme/less'),
path.join(__dirname, 'theme/img'),
path.join(__dirname, 'theme/timeline')
],
extensions: ['','.js','.less','.jpg','.png','.svg']
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
],
module:{
loaders:[
{
test:/\.js$/,
loader:'babel',
exclude:[nodeModulesPath],
query: {presets: ['es2015', 'react']}
},
{
test: /\.(eof|eot|ttf|woff(2)?)(\?[a-z0-9]+)?$/,
loader: "url-loader?name=./bin/font/[name]-[hash].[ext]"
},
{
test: /\.(png|jpg|svg)?$/,
loader: "url-loader?limit=30000&name=./bin/img/[name]-[hash].[ext]"
},
{
test: /\.(less|css)?$/,
loader: 'style!css!less'
}
]
},
and call in file
import 'gradient/uikit' <-- work !
import $ from 'jquery' <--- work !
import 'uikit.js' <--- issue "UI.$ is not a function"
Is there any way. please