28 Commits

Author SHA1 Message Date
b0ffcfd558 Babel: Refactoring config so that it's shared and removes legacy plugin (#32559)
* Updated plugins

* Fixing stuff

* Update

* Fixing more stuff
2021-03-31 19:09:19 +02:00
6065b1b91d DevEnv: updates import of CleanWebpackPlugin to named import (#22800) 2020-03-16 10:52:30 +01:00
9005b484f0 Replace ts-loader with Babel (#21587)
* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Removed redundant import

… that is problematic with Babel's module resolver

* Updated lockfile

* Traspile debug package to es5 for PhantomJS support

* Update babel to latest version

* Remove @babel/poolyfill and url search params polyfill

* Add ts-loader to grafana-ui dependencies

* Update prod webpack build to use cor-js 3

* Applied prettier to relevant webpack configs

* Replaced ng-annotate with babel-plugin-angularjs-annotate

… and replaced ts-loader with @preset/typescript

* Updated lockfile

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-01-30 10:54:11 +01:00
8bc4ef3e9c Revert "Babel: use babel-loader instead of ts-loader, ng-annotate with babel-plugin-angularjs-annotate (#21554)" (#21570)
This reverts #21554 which caused problems with e2e.
This reverts commit e7e0d18bc85928e882030262dbdceb5771194844.
2020-01-17 15:52:56 +01:00
e7e0d18bc8 Babel: use babel-loader instead of ts-loader, ng-annotate with babel-plugin-angularjs-annotate (#21554)
* Applied prettier to some webpack configs

* Removed ng-annotate

… and used same annotation approach as webpack.hot.js

* Removed redundant import

… that is problematic with Babel's module resolver

* Updated lockfile

* Replace ts-loader with babel-loader in webpack.dev

* Change tslint-loade order in dev webpack config

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-01-17 12:36:46 +01:00
7985aa1e57 Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements (#18544)
* Performance/Webpack: Introduces more aggressive code-splitting and other perf improvements
- Introduces dynamic imports for built-in plugins
- Uses dynamic imports for various packages (rst2html, brace)
- Introduces route-based dynamic imports
- Splits angular and moment into separate bundles
2019-09-03 09:29:02 +01:00
eac1459832 Build: watch and dev mode webpack improvements (#18153)
* Ignore `node_modules` in watch mode

* Simplify development setup
2019-07-20 07:46:41 +03:00
be3f9fcbfe fix: Use proper syntax for plugin-syntax-dynamic-import 2019-03-14 08:26:00 +01:00
bdce61d02a chore: Bump clean-webpack-plugin, html-webpack-harddisk-plugin, postcss-reporter 2019-03-14 08:25:56 +01:00
71576a634e Do not use js theme variables in sass (poor dev experience for now) 2019-02-08 14:06:06 +01:00
7626ce9922 WIP Enable js defined theme to be used in SASS 2019-02-04 17:28:57 +01:00
0571ad5ad7 Removes unnecessary warnings from webpack output about missing exports
This should not break anything as ForkTsCheckerWebpackPlugin takes care of that
2019-01-09 11:33:08 +01:00
180ca021b5 Merge branch 'master' into develop 2018-12-05 10:17:22 +01:00
d150b62d06 Stick to .tsx? for babel file test 2018-12-03 16:32:50 +01:00
39a1b11cb3 minor fixes 2018-11-23 15:01:36 +01:00
5038efe09e Merge branch 'master' into davkal/babel-7 2018-11-23 13:44:59 +01:00
fd71abc301 fixed issue with babel plugin proposal class properties that initiated
properties to void 0. This breaks angularjs preAssignBinding which
applies bindings to this before constructor is called. Fixed by
using fork of babel plugin.

https://github.com/babel/babel/issues/8417
2018-11-23 13:41:45 +01:00
e25b2d0ab6 Merge branch 'master' into data-source-settings-to-react 2018-11-07 09:50:17 +01:00
b415d82611 fixed to template PR issues, #13938 2018-11-02 10:49:46 +01:00
16d4109599 reverting babel change 2018-11-01 14:03:02 +01:00
5140325a0d renders angular component 2018-10-31 13:23:05 +01:00
a7bd944098 updated view to use angular loader 2018-10-30 16:40:08 +01:00
c1347e4ecb WIP babel 7 2018-10-29 12:20:10 +01:00
84e431d377 Add tslib to TS compiler
- using tslib reduces bundle sizes
- add compiler option for easier default imports of CJS modules
- remove double entry of fork-ts-checker-plugin
- speed up hot reload by using exprimental ts-loader API
2018-07-25 17:06:44 +02:00
713a87fb5b Webpack 4 (WIP) (#12098)
* Webpack 4

* webpack: force angular version 1.6 as 1.7 has removed a legacy feature toggle Grafana needs, switched from awesome-typescript-loader to ts-loader & forked ts checker

* Webpack 4

* webpack: force angular version 1.6 as 1.7 has removed a legacy feature toggle Grafana needs, switched from awesome-typescript-loader to ts-loader & forked ts checker

* upgrade ts loader

* simplified splitChunks

* upgrade circle node image to v8

* webpack: minor changes, using the new mode option, removed unused awesome-typescript loader, investigating karma issue but no solution yet

* fix: change angular mocks version restriction to be more strict

* add babel-loader for HMR support, fix karma debug runner

* babel-loader to yarn.lock

* webpack: changed from ExtractTextPlugin  to MiniCssExtractPlugin, and updated the minification step to use new webpack4 optimization config section

* webpack: remove css minifcation from general css processing as it's done in the webpack optimization step

* limit vendors chunk to .ts and .js files

* fix: removed typescript compile error, wanted to see if we still got test failure for that

* tech: upgrade uglify-js, should be faster now
2018-06-26 01:28:37 -07:00
56fc82151b Add .html to webpack.hot resolve extensions 2018-06-06 09:12:06 +02:00
6d8d6cdb57 Fix sourcemaps for webpack hot config 2018-05-28 20:32:33 +02:00
ebe8e62bd5 Split webpack dev config into dev and hot
Motivation:

* too many conditionals for config, better to be explicit
* different priorities: faster build for hot mode
* working SCSS sources for styles in hot mode

The biggest differences:

* removed linter from TS loader in hot (should be editor or precommit
 or responsibility)
* simplified styles loading
* hot needs more extensions to resolve
* removed commons chunking for hot
* removed devServer from dev

Reduced HMR time from 8s to 4s on my machine.
2018-05-28 13:49:15 +02:00