Skip to content

Commit

Permalink
Fixed babel errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Szarzynski committed May 23, 2018
1 parent c065724 commit e6e3e45
Show file tree
Hide file tree
Showing 5 changed files with 4,942 additions and 1,323 deletions.
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

20 changes: 15 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node
require("babel-polyfill");
const fs = require("fs");
const MemoryFs = require("memory-fs");
const webpack = require("webpack");
Expand Down Expand Up @@ -43,7 +42,8 @@ program
*/
function compile(entry) {
const compiler = webpack({
entry: ["babel-polyfill", entry],
mode: program.mode === "dev" ? "development" : "production",
entry: [entry],
output: {
filename: BUNDLE_FILE_NAME,
path: "/"
Expand All @@ -56,7 +56,17 @@ function compile(entry) {
use: {
loader: "babel-loader",
options: {
presets: ["env"]
presets: [
[
"@babel/preset-env",
{
targets: {
browsers: ["defaults"]
}
}
]
],
plugins: ["@babel/plugin-transform-runtime"]
}
}
}
Expand All @@ -67,8 +77,8 @@ function compile(entry) {
path: program.env, // Path to .env file (this is the default)
safe: false, // load .env.example (defaults to "false" which does not use dotenv-safe)
silent: true
}),
new webpack.optimize.UglifyJsPlugin()
})
// new webpack.optimize.UglifyJsPlugin()
]
});

Expand Down
Loading

0 comments on commit e6e3e45

Please sign in to comment.