I'm having some issues with babel-loader and cannot for the life of me figure out what is wrong. It does not seem like babel-loader is transpiling at all and I have a suspicion that the babel-loader is not even being used. The result is the same even if i remove everything in the use:
block. Adding the debug: true
flag to options does not change the output in the console. However, the exclude/include options does work, so I am sure that the config is being used. Does anyone have any idea what could be the issue?
var path = require('path');
module.exports = {
mode: 'development',
entry: './project/src/rovbasekart.js',
output: {
filename: 'rovbase.js',
path: path.resolve(__dirname, './project/src/dist')
},
module: {
rules: [{
test: /\.js$/,
include: [path.resolve(__dirname, '/project/src/')],
exclude: [/node_modules/, './project/src/dist', './project/src/lib'], // ignore all files in the node_modules folder
use: {
loader: 'babel-loader',
options: {
presets: [['@babel/preset-env', { "targets": { "browsers": "ie 11"}}]],
babelrc: false
}
}
}]
},
devtool: 'inline-module-source-map',
resolve: {
extensions: ['.js'],
alias: {
Rovbase: path.resolve('./project/src/'),
Verktoylinje: path.resolve('./project/src/verktoylinje'),
Verktoy: path.resolve('./project/src/verktoylinje/Verktoy'),
Styles: path.resolve('./project/src/styles')
}
}
};
Package.json:
"scripts": {
"webpack": "webpack --mode development"
},
"dependencies": {
"@babel/core": "^7.0.0-beta.56",
"@babel/preset-env": "^7.0.0-beta.56",
"babel-loader": "^8.0.0-beta.4",
"ol": "^5.1.3",
"proj4": "^2.4.4",
"webpack": "^4.16.5"
},
"devDependencies": {
"webpack-cli": "^3.1.0"
}