-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Hello!
First off, koodos to author for a fantastic library.
I'm having trouble importing mathjs to frontend through webpack.
Whenever I import mathjs, here's what happens:

The module is imported like any other node module.

And here's my webpack config
var path = require('path')
var webpack = require('webpack')
module.exports = {
entry: ['./src/main.js'],
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/',
filename: 'build.js'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules'),
},
module: {
loaders: [
{ test: /\.jade$/, loader: "jade" },
{
test: /\.js$/,
loader: 'babel',
include: [
path.resolve(__dirname, "src")
]
},
{ test: /\.json$/, loader: 'json' },
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.scss$/, loaders: ["style", "css", "sass"], exclude: /node_modules/ },
{
test: /\.styl$/,
loaders: ["style", "css", "stylus"],
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'url',
query: {
limit: 10000,
name: '[name].[ext]?[hash]'
}
}
]
},
devtool: 'eval-source-map'
}
module.exports.devtool = 'source-map'
// http://vuejs.github.io/vue-loader/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin()
])
No problems, however, using mathjs in node backend.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels