Commit c1347e4e by David Kaltschmidt

WIP babel 7

parent 1f6df77a
{
"presets": [
[
"@babel/preset-env",
{
"targets": { "browsers": "last 3 versions" },
"useBuiltIns": "entry"
}
]
]
}
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
"url": "http://github.com/grafana/grafana.git" "url": "http://github.com/grafana/grafana.git"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.1.0",
"@types/d3": "^4.10.1", "@types/d3": "^4.10.1",
"@types/enzyme": "^3.1.13", "@types/enzyme": "^3.1.13",
"@types/jest": "^23.3.2", "@types/jest": "^23.3.2",
...@@ -21,10 +27,10 @@ ...@@ -21,10 +27,10 @@
"angular-mocks": "1.6.6", "angular-mocks": "1.6.6",
"autoprefixer": "^6.4.0", "autoprefixer": "^6.4.0",
"axios": "^0.17.1", "axios": "^0.17.1",
"babel-core": "^6.26.0", "babel-core": "^7.0.0-bridge",
"babel-loader": "^7.1.4", "babel-jest": "^23.6.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-loader": "^8.0.4",
"babel-preset-es2015": "^6.24.1", "babel-plugin-angularjs-annotate": "^0.9.0",
"clean-webpack-plugin": "^0.1.19", "clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"enzyme": "^3.6.0", "enzyme": "^3.6.0",
...@@ -127,13 +133,12 @@ ...@@ -127,13 +133,12 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@babel/polyfill": "^7.0.0",
"angular": "1.6.6", "angular": "1.6.6",
"angular-bindonce": "0.3.1", "angular-bindonce": "0.3.1",
"angular-native-dragdrop": "1.2.2", "angular-native-dragdrop": "1.2.2",
"angular-route": "1.6.6", "angular-route": "1.6.6",
"angular-sanitize": "1.6.6", "angular-sanitize": "1.6.6",
"babel-jest": "^23.6.0",
"babel-polyfill": "^6.26.0",
"baron": "^3.0.3", "baron": "^3.0.3",
"brace": "^0.10.0", "brace": "^0.10.0",
"classnames": "^2.2.5", "classnames": "^2.2.5",
......
import 'babel-polyfill'; import '@babel/polyfill';
import 'file-saver'; import 'file-saver';
import 'lodash'; import 'lodash';
import 'jquery'; import 'jquery';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// context.keys().forEach(context); // context.keys().forEach(context);
// module.exports = context; // module.exports = context;
import 'babel-polyfill'; import '@babel/polyfill';
import 'jquery'; import 'jquery';
import angular from 'angular'; import angular from 'angular';
import 'angular-mocks'; import 'angular-mocks';
......
...@@ -47,7 +47,7 @@ module.exports = merge(common, { ...@@ -47,7 +47,7 @@ module.exports = merge(common, {
module: { module: {
rules: [ rules: [
{ {
test: /\.tsx?$/, test: /\.(j|t)sx?$/,
exclude: /node_modules/, exclude: /node_modules/,
use: [{ use: [{
loader: 'babel-loader', loader: 'babel-loader',
...@@ -55,17 +55,23 @@ module.exports = merge(common, { ...@@ -55,17 +55,23 @@ module.exports = merge(common, {
cacheDirectory: true, cacheDirectory: true,
babelrc: false, babelrc: false,
plugins: [ plugins: [
'syntax-dynamic-import', ["@babel/plugin-proposal-class-properties", { loose: true }],
'angularjs-annotate',
'syntax-dynamic-import', // needed for `() => import()` in routes.ts
'react-hot-loader/babel' 'react-hot-loader/babel'
] ],
} presets: [
}, [
'@babel/preset-env',
{ {
loader: 'ts-loader', targets: { browsers: 'last 3 versions' },
options: { useBuiltIns: 'entry'
transpileOnly: true, }
experimentalWatchApi: true ],
}, '@babel/preset-typescript',
'@babel/preset-react'
],
}
}], }],
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment