nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit c4e1d2f14603f1f28dc7949456b719a6ef03394e
parent e73318856ae047773192dd8f1b0e9aa633abafa3
Author: Sergej Orlov <wladimirych@gmail.com>
Date:   Wed,  4 Dec 2019 01:14:21 +0100

config: move babel config to webpack config file

Diffstat:
D.babelrc | 23-----------------------
Mwebpack/webpack.config.js | 27++++++++++++++++++++++++++-
2 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/.babelrc b/.babelrc @@ -1,23 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "useBuiltIns": "usage", - "corejs": "3.0.0", - "modules": "commonjs" - } - ] - ], - "overrides": [ - { - "test": "./src/vendored/github.com/augustl/js-unzip/js-unzip.js", - "sourceType": "script" - } - ], - - "plugins": [ - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-proposal-class-properties" - ] -} diff --git a/webpack/webpack.config.js b/webpack/webpack.config.js @@ -15,6 +15,30 @@ const productionOutput = { filename: 'js/[name].[contenthash:8].js' }; +const babelConfig = { + "presets": [ + [ + "@babel/preset-env", + { + "useBuiltIns": "usage", + "corejs": "3.0.0", + "modules": "commonjs" + } + ] + ], + "overrides": [ + { + "test": "./src/vendored/github.com/augustl/js-unzip/js-unzip.js", + "sourceType": "script" + } + ], + + "plugins": [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-proposal-class-properties" + ] +}; + const plugins = [ new CleanWebpackPlugin(), new CopyWebpackPlugin([ @@ -75,7 +99,8 @@ const loaders = [ { test: /\.js$/, exclude: /node_modules/, - use: 'babel-loader' + loader: 'babel-loader', + options: babelConfig }, {