嗨,我一直在努力从Pedro G. Galaviz那里获得这个配置Phoenix和Vue.js https://github.com/pggalaviz/phoenix-vue的示例。
在我的版本( https://github.com/kieranwild/phoenix-vue )中,我复制了简单的webpack /巴别塔的配置-简单的模板https://github.com/vuejs-templates/webpack-simple,但是仍然不能工作。
我让它在这里运行:http://165.227.226.0/,它正在加载标题,但在ie11上只显示一个空白屏幕,没有错误消息。
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
})
])
}发布于 2018-02-19 17:56:06
我认为这是与Webpack的问题。我又改吃早午餐了。
https://stackoverflow.com/questions/48765903
复制相似问题