Type error during importing vue-formio to my vue template - vue.js

I have a problem with importing vue-formio to my vue component.
Can't import FormBuilder without errors :(
After:
import { FormBuilder } from 'vue-formio';
I see in the console:
TypeError: Object prototype may only be an Object or null: undefined
Whole error You can see here: see print screen
TypeError: Object prototype may only be an Object or null: undefined
Main import:
if (document.body.classList.contains("hr:controller-requisition:action-edit")) {
require.ensure([], () => {
require("./views/requisition/edit.es6.js").default;
});
}
My formio.es6.js file:
import Vue from "vue";
import formio from "./show.vue";
import { store } from "HRComponets/store/store.es6";
export default new Vue({
el: "#formio-show",
data: {},
store,
render(h) {
return h(formio);
}
});
My vue component file:
Hi Guys, need help with vue-formio
<script>
import { FormBuilder } from 'vue-formio';
export default {
name: "formioShow",
data() {
return {
schema: {},
}
},
components: {
FormBuilder
},
};
</script>
My package.json file:
{
"name": "core",
"version": "1.0.0",
"description": "ortal",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"start": "npm run dev",
"prod": "webpack --config webpack.prod.js",
"dev": "webpack --watch --progress --config webpack.dev.js",
},
"nyc": {
"include": [
"src/**/*.(js|vue)"
],
"instrument": false,
"sourceMap": false
},
"keywords": [
"HR",
"Syrveys"
],
"browserslist": [
"> 2%",
"last 3 versions",
"not ie <= 8"
],
"devDependencies": {
"#vue/test-utils": "^1.0.0-beta.18",
"axios": "^0.18.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"expect": "^23.1.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"husky": "^1.0.0-rc.8",
"istanbul-instrumenter-loader": "^3.0.1",
"jsdom": "^11.11.0",
"jsdom-global": "^3.0.2",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"mini-css-extract-plugin": "^0.4.0",
"mocha": "^5.2.0",
"mocha-webpack": "^2.0.0-beta.0",
"node-sass": "^4.9.0",
"nyc": "^11.8.0",
"prettier-eslint": "^8.8.1",
"sass-loader": "^7.0.1",
"style-loader": "^0.21.0",
"ts-loader": "^5.1.0",
"typescript": "^3.0.3",
"vue": "^2.5.16",
"vue-loader": "^15.0.10",
"vue-template-compiler": "^2.5.16",
"watchfile-webpack-plugin": "0.0.4",
"webpack": "^4.8.1",
"webpack-cli": "^2.1.3",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.2",
"webpack-notifier": "^1.6.0"
},
"dependencies": {
"amcharts3": "github:amcharts/amcharts3",
"eslint-plugin-vue": "^4.7.1",
"formiojs": "^3.5.1",
"jquery": "^3.3.1",
"lodash": "^4.17.10",
"moment-timezone": "^0.5.17",
"npm": "^6.4.1",
"numeral": "^2.0.6",
"vee-validate": "^2.1.0-beta.8",
"vue-formio": "^3.0.0",
"vue-moment": "^4.0.0-0",
"vue-multiselect": "^2.1.0",
"vue-numerals": "0.0.2",
"vue-pdf": "^3.3.1",
"vue-upload-component": "^2.8.9",
"vue-wysiwyg": "^1.7.2",
"vue2-dropzone": "^3.2.2",
"vuelidate": "^0.7.4",
"vuenut": "^0.2.2",
"vuex": "^3.0.1",
"webpack-node-externals": "^1.7.2"
}
}
My webpack config file:
const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const HTMLWebpackPlugin = require("html-webpack-plugin");
const config = {
entry: {
core: "./src/AppBundle/VueComponents/main.es6.js",
hr: "./src/HRBundle/VueComponents/main.es6.js",
pm: "./src/PerformanceManagementBundle/VueComponents/main.es6.js"
},
output: {
filename: "[name]-app.js",
path: __dirname + "/web/assets/core/js/",
hotUpdateChunkFilename: "../webpack-hot-reload/hot-update.js",
hotUpdateMainFilename: "../webpack-hot-reload/Updatehot-update.json",
publicPath: "/assets/core/js/"
},
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
ignored: /node_modules/
},
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.ts$/,
exclude: /node_modules|vue\/src/,
loader: "ts-loader",
options: {
appendTsSuffixTo: [/\.vue$/]
}
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /.scss$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.less$/,
use: ["vue-style-loader", "css-loader", "less-loader"]
},
{
test: /\.es6.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: "babel-loader"
}
}
]
},
plugins: [
new VueLoaderPlugin(),
new HTMLWebpackPlugin(),
new webpack.HotModuleReplacementPlugin(),
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
})
],
externals: {
jquery: "jQuery"
},
resolve: {
alias: {
vue: "vue/dist/vue.js",
HRComponets: path.resolve(__dirname, "./src/HRBundle/VueComponents")
},
extensions: ["*", ".js", ".vue", ".json", ".ts"]
}
};
module.exports = config;

Related

Vue v2.7 & Pinia v2.0.22 throwing devtools-api error during build

Here is my dependency tree:
"dependencies": {
"#s-r0/eggy-js": "^1.3.4",
"#shopify/theme-predictive-search": "^4.0.0",
"#splidejs/vue-splide": "^0.5.18",
"axios": "^0.21.1",
"carousel-carousel": "^0.1.24",
"embla-carousel": "^2.9.1",
"eslint-config-prettier": "^6.12.0",
"eslint-plugin-prettier": "^3.1.4",
"lazysizes": "^5.2.2",
"module-name": "^0.0.1-security",
"pinia": "^2.0.22",
"v-tooltip": "^2.0.3",
"vendor": "^1.7.0",
"vue": "^2.7",
"vue-click-outside-element": "^1.0.15",
"vue-scrollto": "^2.20.0",
"vue2-transitions": "^0.3.0",
"vuejs-datepicker": "^1.6.2"
},
"devDependencies": {
"#babel/core": "^7.10.1",
"#babel/plugin-transform-destructuring": "^7.10.1",
"#babel/plugin-transform-object-assign": "^7.10.1",
"#babel/plugin-transform-runtime": "^7.10.1",
"#babel/preset-env": "^7.10.1",
"#shopify/eslint-plugin": "^39.0.1",
"#shopify/stylelint-plugin": "^10.0.1",
"#shopify/themekit": "~1.1.4",
"#vue/cli-plugin-babel": "~4.5.0",
"#vue/cli-plugin-unit-jest": "~4.5.0",
"#vue/cli-service": "~4.5.0",
"#vue/test-utils": "^1.0.3",
"babel-loader": "^8.1.0",
"babel-plugin-dynamic-import-node": "^2.3.3",
"browser-sync": "^2.26.7",
"concurrently": "^5.2.0",
"copyfiles": "^2.3.0",
"css-loader": "^4.2.0",
"cssnano": "^4.1.10",
"eslint": "^7.11.0",
"eslint-plugin-vue": "^9.0.0",
"file-loader": "^6.0.0",
"jest-vue-preprocessor": "^1.7.1",
"node-watch": "^0.6.4",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"rimraf": "^3.0.2",
"sass": "^1.26.7",
"sass-loader": "^8.0.2",
"stylelint": "^13.7.2",
"stylelint-order": "^4.1.0",
"vue-loader": "^15.10.0",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
I can install my dependencies with either NPM or yarn just fine. However, when I run my script for webpack to bundle everything, I keep getting the error:
ERROR in ./node_modules/pinia/dist/pinia.mjs
Module not found: Error: Can't resolve '#vue/devtools-api' in '/Users/gabe/Documents/GitHub/hive-brands/node_modules/pinia/dist'
# ./node_modules/pinia/dist/pinia.mjs 7:0-56 505:4-23 709:4-23
# ./src/vue/theme.js
# ./src/scripts/theme.js
# multi ./src/scripts/theme.js ./src/styles/theme.scss
Here is my webpack config just in case:
const path = require("path");
const VueLoaderPlugin = require("vue-loader/lib/plugin");
const webpackConfig = {
mode: "production",
resolve: {
alias: {
"#scripts": path.resolve(__dirname, "src/vue"),
"#vue": path.resolve(__dirname, "src/vue")
}
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /theme.scss/,
exclude: /node_modules/,
use: [
{
loader: "file-loader",
options: { name: "theme.min.css" }
},
"sass-loader"
]
},
{
test: /checkout.scss/,
exclude: /node_modules/,
use: [
{
loader: "file-loader",
options: { name: "checkout.min.css" }
},
"sass-loader"
]
},
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
}
]
},
plugins: [new VueLoaderPlugin()]
};
const themeConfig = {
...webpackConfig,
name: "theme",
entry: [
`${__dirname}/src/scripts/theme.js`,
`${__dirname}/src/styles/theme.scss`
],
output: {
path: path.join(__dirname, "src/assets"),
filename: "theme.min.js"
}
};
const checkoutConfig = {
...webpackConfig,
name: "checkout",
entry: [
`${__dirname}/src/scripts/checkout.js`,
`${__dirname}/src/styles/checkout.scss`
],
output: {
path: path.join(__dirname, "src/assets"),
filename: "checkout.min.js"
}
};
module.exports = [themeConfig, checkoutConfig];

vuejs 3: not rendered template from sfc component

I have one project with webpack and i want to add vue to this.
Vue work (function via mounted() show console.log), but i can't render template from sfc component.
Not errors in console.
This trouble component Departments.vue:
<template lang="pug">
.cont
.department 111
</template>
<script>
export default {
name: 'departments',
data() {
return {
deps: '',
}
},
props: {
list: {
type: String,
default: ''
}
},
beforeMount() {
console.log('before');
},
mounted() {
console.log('mount');
}
}
</script>
html(just on the one single page):
<div id="app">
<hr/>
lala <br/>
<departments list='vue list'></departments>
<hr/>
<test></test>
</div>
in app.js:
import { createApp } from 'vue'
import departments from './components/Departments.vue';
const app = createApp({
data() {
return {
count: 134
}
},
// components: {
// departments,
// },
})
app.component('departments', departments)
app.component('test', {
template : '<div><h1>This is coming from component</h1></div>'
})
app.mount('#app')
For testing i added test component inline into app.js - and it's worked!
Here result:
my broken component showing '< ! ---- >' symbols...
package.json
{
"name": "---",
"version": "1.0.0",
"description": "just show me vue templates",
"main": "index.js",
"scripts": {
"dev": "webpack --mode development",
"build": "webpack --mode production"
},
"author": "",
"license": "ISC",
"devDependencies": {
"#vue/compiler-sfc": "^3.2.37",
"autoprefixer": "^10.4.7",
"babel-core": "^6.26.3",
"babel-loader": "^8.2.5",
"babel-preset-env": "^1.7.0",
"browser-sync": "^2.27.10",
"browser-sync-webpack-plugin": "^2.3.0",
"chartist-plugin-pointlabels": "^0.0.6",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
"cssnano": "^5.1.12",
"html-webpack-plugin": "^5.5.0",
"jquery": "^3.6.0",
"jquery-mask-plugin": "^1.14.16",
"jquery.cookie": "^1.4.1",
"jquery.photoswipe": "^1.1.1",
"magnific-popup": "^1.1.0",
"mini-css-extract-plugin": "^2.6.1",
"node-loader": "^2.0.0",
"node-sass": "^7.0.1",
"nouislider": "^15.6.0",
"photoswipe": "^5.2.8",
"postcss-loader": "^7.0.1",
"pug": "^2.0.4",
"pug-html-loader": "^1.1.5",
"pug-plain-loader": "^1.1.0",
"resolve-url-loader": "^5.0.0",
"sass": "^1.53.0",
"sass-loader": "^13.0.2",
"style-loader": "^3.3.1",
"swiper": "^8.3.1",
"url-loader": "^4.1.1",
"vue-loader": "^17.0.0",
"vue-style-loader": "^4.1.3",
"vue-template-compiler": "^2.7.7",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-node-externals": "^3.0.0"
},
"dependencies": {
"#babel/core": "^7.18.6",
"afterglowplayer": "^1.1.0",
"bigpicture": "^2.6.2",
"chartist": "^0.11.4",
"clean-webpack-plugin": "^4.0.0",
"file-loader": "^6.2.0",
"imagemin-mozjpeg": "^10.0.0",
"imagemin-webpack-plugin": "^2.4.2",
"lity": "^2.4.1",
"vue": "^3.2.37",
"vue-click-outside": "^1.1.0"
}
}
webpack.config.js
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
const CopyWebpackPlugin = require('copy-webpack-plugin');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
entry: { main: './src/js/app.js' },
output: {
path: path.resolve(),
filename: '../js/bundle.js'
},
target: 'node',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.scss$/,
use: [
'style-loader',
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
url: false,
},
},
'postcss-loader',
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true
}
}
]
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}]
},
{
test: /\.(png|gif)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'images/plugins'
}
}]
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.pug$/,
loader: 'pug-plain-loader'
}
]
},
plugins: [
new BrowserSyncPlugin({
host: 'localhost',
port: 3000,
server: { baseDir: [path] }
}),
new CopyWebpackPlugin({
patterns:[
{from: 'src/img/', to: '../images/',},
{from: 'src/fonts/', to: '../fonts/',}
]
}),
new ImageminPlugin({
pngquant: {
quality: '100'
},
}),
new MiniCssExtractPlugin({
filename: '../template_styles.css',
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
new VueLoaderPlugin(),
],
};
can you help me with this error?

How to configure Tailwind + Postcss with VueJS in Laravel InertiaJS

I am new to setting up the tailwind/postcss configuration using Intertia.js/Vue.js and would appreciate some guidance with my configuration files!
My goal is to be able to write postcss/scss style within my vue components, with the ability to use the postcss #apply functionality for example, like so:
Navigation.vue:
<style lang="postcss">
.nav-items {
#apply bg-red;
}
</style>
With the current configuration setup I have, I am not getting any errors compiling however the style is not being applied, it doesn't appear in the Styles in console for the element.
webpack.mix.js
const mix = require('laravel-mix')
const path = require('path')
const purgecss = require('#fullhuman/postcss-purgecss')
const tailwindcss = require('tailwindcss')
mix.js('resources/js/app.js', 'public/js')
.postCss('resources/css/app.css', 'public/css/app.css')
.options({
postCss: [
tailwindcss('tailwind.config.js'),
...mix.inProduction() ? [
purgecss({
content: ['./resources/views/**/*.blade.php', './resources/js/**/*.vue'],
defaultExtractor: content => content.match(/[\w-/:.]+(?<!:)/g) || [],
whitelistPatternsChildren: [/nprogress/],
}),
] : [],
],
})
.webpackConfig({
output: { chunkFilename: 'js/[name].js?id=[chunkhash]' },
resolve: {
alias: {
vue$: 'vue/dist/vue.runtime.js',
'#': path.resolve('resources/js'),
ziggy: path.resolve('vendor/tightenco/ziggy/src/js/route.js'),
},
},
module: {
rules: [
{
test: /\.postcss$/,
loaders: [
"style-loader",
{
loader: "css-loader",
options: { modules: true, importLoaders: 1 }
},
"postcss-loader",
]
}
]
}
})
.version()
.sourceMaps()
tailwind.config.js:
const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
purge: [
'./resources/views/**/*.blade.php',
'./resources/css/**/*.css',
],
sourceMap: false,
theme: {
//...
},
plugins: [],
}
postcss.config.js:
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
],
};
package.json:
{
//...
"devDependencies": {
"#babel/preset-env": "^7.9.6",
"#tailwindcss/custom-forms": "^0.2.1",
"axios": "^0.19",
"cross-env": "^7.0",
"css-loader": "^3.5.3",
"laravel-mix": "^5.0.1",
"laravel-mix-tailwind": "^0.1.0",
"lodash": "^4.17.13",
"postcss-css-variables": "^0.17.0",
"postcss-loader": "^3.0.0",
"postcss-nesting": "^7.0.1",
"resolve-url-loader": "^3.1.0",
"sass": "^1.15.2",
"sass-loader": "^8.0.0",
"style-loader": "^1.2.1",
"tailwindcss": "^1.4",
"vue-svgicon": "^3.2.6",
"vue-template-compiler": "^2.6.11"
},
"dependencies": {
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#inertiajs/inertia": "^0.1.9",
"#inertiajs/inertia-vue": "^0.1.4",
"alpinejs": "^2.3.5",
"popper.js": "^1.16.1",
"portal-vue": "^2.1.7",
"postcss-import": "^12.0.1",
"postcss-nested": "^4.2.1",
"postcss-nested-ancestors": "^2.0.0",
"vue": "^2.6.11",
"vue-i18n": "^8.17.7",
"vue-meta": "^2.3.3"
}
}
Add this to webpack.config.js :
module: {
rules: [
{
test: /\.(postcss)$/,
use: [
'vue-style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
}
],
},
Found here https://github.com/JeffreyWay/laravel-mix/issues/2211#issuecomment-546123921

use async \ await in vue?

I want to use async \ await in Vue.
there is order-list.vue, in short methods this is:
getOrder: function () {
return new Promise(function (resolve, reject) {
setTimeout(() => {
console.log('hello world');
resolve(true)
}, 2000)
});
},
example: async() => {
console.log('start');
for (let i in this.orders) {
await this.getOrder().then(
console.log('loaded ' + i)
)
}
console.log('finish');
}
it's all going to webpack.
When I start webpack, I get this message
ERROR in ./erp/vue/order-list.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./erp/vue/order-list.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '#babel/runtime/regenerator' in '/Users/pankovalxndr/Sites/mysite/erp/vue'
# ./erp/vue/order-list.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./erp/vue/order-list.vue?vue&type=script&lang=js&) 1:0-61 141:13-32 146:28-47 156:21-40
package.json
What is wrong here?
"devDependencies": {
"#babel/core": "^7.4.3",
"#babel/plugin-transform-runtime": "^7.6.2",
"#babel/preset-env": "^7.4.3",
"autoprefixer": "^8.6.5",
"babel-loader": "^8.0.0-beta.6",
"babel-runtime": "^6.26.0",
"gulp": "git://github.com/gulpjs/gulp.git#6d71a658c61edb3090221579d8f97dbe086ba2ed",
"gulp-cheerio": "^0.6.3",
"gulp-cssnano": "^2.1.2",
"gulp-postcss": "^7.0.1",
"gulp-print": "^5.0.2",
"gulp-rename": "^1.4.0",
"gulp-replace": "^0.6.1",
"gulp-sass": "^3.1.0",
"gulp-svg-sprite": "^1.5.0",
"gulp-svgmin": "^1.2.4",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"vue-loader": "^15.7.2",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.5.17",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0"
}
My .babelrc
What is wrong here?
{
"presets": [
"#babel/preset-env"
],
"plugins": [
[
"#babel/plugin-transform-runtime",
{
"regenerator": true
}
]
]
}
webpack file
What is wrong here?
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
}, {
test: /\.js$/,
use: 'babel-loader'
}
]
},
plugins: [
new VueLoaderPlugin(),
]
If I remove functions with await then everything starts to work well, those things are not specifically, more precisely in some module

Webpack build not updating contents on Apache server

I have an Angular2 webpack project which works fine in local(webpack-dev-server) but once I deploy to my server(Apache), and run "npm run build", the build does not get updated(no errors shown).I tried removing my dist folder but still no change.No changes made to html are shown(it was working perfectly fine before)
webpack.config.js -->
var path = require('path'),
webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: {
app: './src/main'
},
output: {
path: path.resolve(__dirname, './dist'),
filename: 'app.bundle.js'
},
resolve: {
extensions: ['.js', '.ts','.tsx', '.css', '.scss', '.html']
},
module: {
rules: [{
test: /\.ts$/,
use: ['awesome-typescript-loader', 'angular2-template-loader', '#angularclass/hmr-loader', 'angular2-router-loader'],
exclude: [/\.(spec|e2e)\.ts$/, /node_modules\/(?!(ng2-.+))/]
},
{
test: /\.scss$/,
exclude: [/node_modules/],
use: [
'raw-loader',
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
// Or array of paths
resources: [
'./src/assets/sharedStyles/_variables.scss',
'./src/assets/sharedStyles/_mixins.scss'
]
},
}
]
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.html$/, loader: 'raw-loader' },
{ test: /\.(eot|ttf|wav|mp3|pdf|woff2|woff|png|svg|gif)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }
]
},
// plugins
plugins: [
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)#angular/,
__dirname // location of your src
),
new HtmlWebpackPlugin({
template: './src/index.html',
chunksSortMode: 'dependency'
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new CopyWebpackPlugin([{
from: './src/assets',
to: './assets',
copyUnmodified: true,
force: true
}])
],
devServer: {
contentBase: path.join(__dirname, "src/"),
compress: true,
port: 3000,
historyApiFallback: true,
inline: true
}
};
package.json-->
{
"name": "App",
"version": "1.0.0",
"scripts": {
"postinstall": "typings install",
"typings": "typings",
"start": "webpack-dev-server --public --port 3000 --hot --host 0.0.0.0",
"build": "webpack",
"build-prod": "webpack -p"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"dependencies": {
"#angular/animations": "^4.1.2",
"#angular/common": "^4.1.2",
"#angular/compiler": "^4.1.2",
"#angular/compiler-cli": "^4.1.2",
"#angular/core": "^4.1.2",
"#angular/forms": "^4.1.2",
"#angular/http": "^4.1.2",
"#angular/platform-browser": "^4.1.2",
"#angular/platform-browser-dynamic": "^4.1.2",
"#angular/platform-server": "^4.1.2",
"#angular/router": "^4.1.2",
"#angular/upgrade": "4.1.2",
"angular-in-memory-web-api": "~0.1.5",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"d3": "^4.9.1",
"html-webpack-plugin": "^2.28.0",
"jquery": "2.x.x",
"jquery-ui": "^1.10.3",
"jquery-ui-npm": "^1.12.0",
"ngx-bootstrap": "^1.6.6",
"primeui": "^4.1.15",
"reflect-metadata": "0.1.9",
"rxjs": "5.1.0",
"systemjs": "0.19.39",
"typescript": "^2.4.1",
"zone.js": "0.7.2"
},
"devDependencies": {
"#angularclass/hmr-loader": "^3.0.2",
"#types/jquery": "^2.0.33",
"angular2-router-loader": "^0.3.4",
"angular2-template-loader": "^0.6.2",
"awesome-typescript-loader": "^3.0.3",
"concurrently": "^3.0.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.10.1",
"google-maps": "^3.2.1",
"lite-server": "^2.2.2",
"ng2-cookies": "^1.0.6",
"ng2-datetime": "1.2.1",
"ng2-popover": "0.0.13",
"node-sass": "^4.5.0",
"primeng": "^4.1.0-rc.2",
"primeui": "^4.1.15",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.0",
"sass-resources-loader": "^1.2.0",
"smartadmin-plugins": "^1.0.15",
"style-loader": "^0.13.2",
"to-string-loader": "^1.1.5",
"ts-loader": "^2.0.0",
"typings": "2.1.0",
"webpack": "^2.2.1",
"webpack-dev-server": "^2.3.0"
}
}