简体   繁体   中英

Phoenix - Vue polyfill blank screen on ie11

Hi I have been working on getting this example from Pedro G. Galaviz that configures Phoenix and Vue.js https://github.com/pggalaviz/phoenix-vue

In my version of it ( https://github.com/kieranwild/phoenix-vue ) I have copied across the webpack / babel configuation from simple webpack-simple template https://github.com/vuejs-templates/webpack-simple but it still does not work.

I have it running here: http://165.227.226.0/ It is loading the title but is just showing a blank screen on ie11 with no error messages.

main.js

import 'babel-polyfill’
import ‘es6-promise/auto’
import Phoenix_html from 'phoenix_html’
import { Socket } from 'phoenix’
import Vue from 'vue’
import App from ‘./App’

Vue.config.productionTip = false

new Vue({
el: ‘#app’,
template: ‘’,
components: { App }
})

webpack.config.js

var path = require(‘path’)
var webpack = require(‘webpack’)

module.exports = {
entry: [‘babel-polyfill’, ‘./src/main.js’],
output: {
path: path.resolve(__dirname, ‘./dist’),
publicPath: ‘/dist/’,
filename: ‘build.js’
},
module: {
rules: [
{
test: /.css$/,
use: [
‘vue-style-loader’,
‘css-loader’
],
},
{
test: /.scss$/,
use: [
‘vue-style-loader’,
‘css-loader’,
‘sass-loader’
],
},
{
test: /.sass$/,
use: [
‘vue-style-loader’,
‘css-loader’,
‘sass-loader?indentedSyntax’
],
},
{
test: /.vue$/,
loader: ‘vue-loader’,
options: {
loaders: {
configs here.
‘scss’: [
‘vue-style-loader’,
‘css-loader’,
‘sass-loader’
],
‘sass’: [
‘vue-style-loader’,
‘css-loader’,
‘sass-loader?indentedSyntax’
]
}
}
},
{
test: /.js$/,
loader: ‘babel-loader’,
exclude: /node_modules/
},
{
test: /.(png|jpg|gif|svg)$/,
loader: ‘file-loader’,
options: {
name: ‘[name].[ext]?[hash]’
}
}
]
},
resolve: {
alias: {
‘vue$’: ‘vue/dist/vue.esm.js’
},
extensions: [’*’, ‘.js’, ‘.vue’, ‘.json’]
},
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
performance: {
hints: false
},
devtool: ‘#eval-source-map’
}
if (process.env.NODE_ENV === ‘production’) {
module.exports.devtool = ‘#source-map’
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
‘process.env’: {
NODE_ENV: ‘“production”’
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}

I think it was a problem with Webpack. I have reverted to Brunch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM