1 | ;
|
2 |
|
3 | module.exports = [
|
4 | // Legacy decorator transform with the old decorator behavior from Babel@5
|
5 | // There are some caveats as to how to set this up:
|
6 | // https://new.babeljs.io/docs/en/next/babel-plugin-proposal-decorators.html
|
7 | ['@babel/plugin-proposal-decorators', {legacy: true}],
|
8 |
|
9 | // Dynamic imports in order to use Webpack's ModuleConcatenationPlugin
|
10 | ['@babel/plugin-syntax-dynamic-import'],
|
11 |
|
12 | // Stage-2 public class fields
|
13 | // This interacts with @babel/plugin-proposal-decorators above.
|
14 | ['@babel/plugin-proposal-class-properties', {loose: true}],
|
15 |
|
16 | // Adds 'use strict'; to each file - Webpack adds it only for modules with ES6+ import / export
|
17 | ['@babel/plugin-transform-strict-mode'],
|
18 |
|
19 | // babel-plugin-react-css-modules
|
20 | [
|
21 | 'babel-plugin-react-css-modules',
|
22 | {
|
23 | filetypes: {
|
24 | '.less': {
|
25 | syntax: 'postcss-less',
|
26 | },
|
27 | },
|
28 | exclude: '\\.global\\.less$',
|
29 | // This pattern also exists in udemy-django/static/webpack/helpers/less-loaders.js.
|
30 | generateScopedName: '[name]--[local]--[hash:base64:5]',
|
31 | },
|
32 | ],
|
33 |
|
34 | // Deduplication helpers
|
35 | ['@babel/plugin-external-helpers'],
|
36 | ];
|