Answer the question
In order to leave comments, you need to log in
Why does import throw an error _splidejs_splide__WEBPACK_IMPORTED_MODULE_0__ is not a constructor?
Good afternoon, I'm trying to use the Splide slider, webpack is used for assembly, more precisely gulp with the webpack setting,
here is the task for scripts
function scripts() {
return src(["app/js/*.js", "!app/js/*.min.js"])
.pipe(
webpackStream(
{
mode: 'development',
performance: {hints: false},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"],
plugins: ["babel-plugin-root-import"],
},
},
},
],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {format: {comments: false}},
extractComments: false,
}),
],
},
},
webpack
)
)
.on("error", function handleError() {
this.emit("end");
})
.pipe(concat("app.min.js"))
.pipe(dest("app/js"))
.pipe(browserSync.stream());
}
import Splide from '@splidejs/splide';
var splide = new Splide( '.splide' ).mount();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question