Comments (4)
You don't add the package there directly, but define a plugin file for it https://nuxtjs.org/api/configuration-plugins and should work. Also make sure to include the dist file from the package.
from laravel-nuxt.
In nuxt.config.js in the plugins array I try to add a plugin pstephan1187/vue-datatable (it uses ES6 syntax). Like this:
module.exports = { plugins: [ '~components/global', '~plugins/axios', '~plugins/datatable', ],
After this It absolutely works in Chrome but I get error in IE10, IE11 - Syntax error (class Settings { constructor() ...)
In /plugins/datatable.js
I do
import Vue from 'vue'; import DatatableFactory from 'vuejs-datatable'; Vue.use(DatatableFactory);
This module doesn't use dist file when I import it from 'vuejs-datatable'.
How can I import module with transform to ES2015 from sources (not dist) folder?
from laravel-nuxt.
You have to extend the build rules and tell it to also include that library. Check the Nuxt docs.
from laravel-nuxt.
You are right! Thank you a lot!
I resolved the problem nuxt.config.js
build: {
extend (config, { isServer}) {
config.module.rules.push({
test: /\.js$/,
include: [
path.resolve(__dirname, '../node_modules/vuejs-datatable/')
],
loader: 'babel-loader',
options: this.getBabelOptions({ isServer })
})
},
and this path.resolve(__dirname, '../node_modules/vuejs-datatable/')
should be right path.
from laravel-nuxt.
Related Issues (20)
- SSR and MustVerifyEmail issue
- "Generating optimized autoload files" step on project scaffolding fails with error
- unable to generate token using socialite login
- blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource HOT 2
- User data not saved by store.dispatch HOT 1
- "Make sure to run npm run build!" whenever I try to connect to the Laravel part.
- how to use with laravel vapor HOT 1
- High CPU usage when running `dev` command
- User info not showing up in settings HOT 1
- I cant use yarn. HOT 2
- _vm.form.errors.has is not a function HOT 1
- Can't access laravel on localhost HOT 4
- Login with name instead of email HOT 1
- Classic laravel page on subdomain HOT 4
- Global Component not working. HOT 3
- http://localhost:8000/oauth/github/callback => Make sure to run npm run build!
- Installation fail HOT 3
- Will there be a nuxt3 version coming? HOT 2
- Cannot get CORS to work in production HOT 1
- how to deploy to hosting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-nuxt.