Closed johnfumaster closed 4 years ago
hey @johnfumaster mjs creates es6 javascript, which uses the ()=>
function syntax.
If you want to use uglify on that, you'll have to run it through babel.
cheers
@spencermountain but I am using babel. The rest of my project is using () =>
Here is my module settings from webpack related to babel
{
test: /\.m?js$/,
loader: "babel-loader",
include: [
resolve("src"),
resolve("test"),
resolve("node_modules/webpack-dev-server/client")
],
exclude: [/node_modules/, resolve('src/lang')],
options: {
plugins: ['lodash'],
presets: [['@babel/env']]
}
},
I'm currently importing spacetime like so.
import spacetime from 'spacetime
;Everything works fine, but once it goes to build, it errors out with this error.
I'm not sure what could have caused this, nor could I find any solutions online.
Currently, in order to get my project to build, I have to import from the build directory. So it's got something to do with the
.mjs